mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
Most of the original conversion is from the spatch below,
but I edited some and left out other instances that were
either buggy after conversion (where default values don't
fit into the type) or just looked strange.
@@
expression attr, def;
expression val;
identifier fn =~ "^nla_get_.*";
fresh identifier dfn = fn ## "_default";
@@
(
-if (attr)
- val = fn(attr);
-else
- val = def;
+val = dfn(attr, def);
|
-if (!attr)
- val = def;
-else
- val = fn(attr);
+val = dfn(attr, def);
|
-if (!attr)
- return def;
-return fn(attr);
+return dfn(attr, def);
|
-attr ? fn(attr) : def
+dfn(attr, def)
|
-!attr ? def : fn(attr)
+dfn(attr, def)
)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@kernel.org>
Link: https://patch.msgid.link/20241108114145.0580b8684e7f.I740beeaa2f70ebfc19bfca1045a24d6151992790@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||
|---|---|---|
| .. | ||
| actions.c | ||
| conntrack.c | ||
| conntrack.h | ||
| datapath.c | ||
| datapath.h | ||
| dp_notify.c | ||
| drop.h | ||
| flow.c | ||
| flow.h | ||
| flow_netlink.c | ||
| flow_netlink.h | ||
| flow_table.c | ||
| flow_table.h | ||
| Kconfig | ||
| Makefile | ||
| meter.c | ||
| meter.h | ||
| openvswitch_trace.c | ||
| openvswitch_trace.h | ||
| vport-geneve.c | ||
| vport-gre.c | ||
| vport-internal_dev.c | ||
| vport-internal_dev.h | ||
| vport-netdev.c | ||
| vport-netdev.h | ||
| vport-vxlan.c | ||
| vport.c | ||
| vport.h | ||