[PATCH batadv 0/2] batman-adv: cleanup variable declarations
Sven Eckelmann <[email protected]> Tue, 09 Jun 2026 17:57:39 +0200
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
The Linux coding style suggests to use single variable declarations per line. This suggestion turned out to make reviewing patches easier when single variable declarations are modified. Instead of having to search for the modified variable, it is directly visible as a line change in the diff. Most functions are already using this style. The remaining ones are just adjusted by splitting the lines without ensuring the reverse x-mas tree order because this makes it easier to check the modification. The latter is handled in a second patch. The network related code should use for local variable declarations an ordering scheme which orders lines longest to shortest. Initializations should only be kept in the declarations when the dependencies between them are not preventing the reverse x-mas tree order. Many functions are already using this order. The remaining ones were supposed to slowly convert to the x-mas tree order when working on them. But this never happened because the patches tried to only modify the relevant lines. Instead of getting better, the order often just became worse. Just fix the remaining offending functions to finally solve this coding style (minor) problem. Signed-off-by: Sven Eckelmann <[email protected]> --- Sven Eckelmann (2): batman-adv: split multiple declarations per line batman-adv: switch var declarations to reverse x-mas tree order net/batman-adv/bat_algo.c | 6 +- net/batman-adv/bat_iv_ogm.c | 145 +++++++++++++---------- net/batman-adv/bat_v.c | 39 +++--- net/batman-adv/bat_v_elp.c | 19 +-- net/batman-adv/bat_v_ogm.c | 34 +++--- net/batman-adv/bridge_loop_avoidance.c | 98 ++++++++------- net/batman-adv/distributed-arp-table.c | 105 ++++++++++------- net/batman-adv/fragmentation.c | 34 +++--- net/batman-adv/gateway_client.c | 29 +++-- net/batman-adv/gateway_common.c | 6 +- net/batman-adv/hard-interface.c | 12 +- net/batman-adv/hash.h | 8 +- net/batman-adv/log.h | 16 ++- net/batman-adv/main.c | 18 +-- net/batman-adv/mesh-interface.c | 45 +++---- net/batman-adv/multicast.c | 33 +++--- net/batman-adv/multicast_forw.c | 15 ++- net/batman-adv/netlink.c | 8 +- net/batman-adv/originator.c | 53 +++++---- net/batman-adv/routing.c | 63 ++++++---- net/batman-adv/send.c | 7 +- net/batman-adv/tp_meter.c | 49 +++++--- net/batman-adv/translation-table.c | 210 +++++++++++++++++++-------------- net/batman-adv/tvlv.c | 24 ++-- 24 files changed, 621 insertions(+), 455 deletions(-) --- base-commit: 385b248dd4e46c4ce022adeb1b13e547d1954901 change-id: 20260608-reverse-xmas-6109a777ef8a Best regards, -- Sven Eckelmann <[email protected]>