From: Maxime Chevallier Date: Thu, 19 Mar 2026 18:05:54 +0000 (+0100) Subject: net: ethtool: re-order local includes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a5852595f5afb36aebddcc3ebc2654ee4d3879;p=thirdparty%2Flinux.git net: ethtool: re-order local includes Most local #include in the ethtool command handling is out of order, with either : #include "netlink.h" #include "common.h" or even : #include "netlink.h" #include "common.h" #include "bitset.h" One of the reasons is because bitset.h s lacking definitions for nlattr, netlink_ext_ack, ETH_GSTRING_LEN, and types such as u32, bool, etc. Make bitset.h standalone by including for ETH_GSTRING_LEN, and for nlattr, netlink_ext_ack and the rest. While at it, take a pass on ethnl sources to re-order the local includes : - put them after the global includes - add a newline between global and local includes - alpha-sort the local includes One notable exception is the cmis.h include, that needs definitions from module_fw.h. Keep them in this order for now. Signed-off-by: Maxime Chevallier Link: https://patch.msgid.link/20260319180555.1531386-1-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski --- diff --git a/net/ethtool/bitset.c b/net/ethtool/bitset.c index f0883357d12e5..8bb98d3ea3db2 100644 --- a/net/ethtool/bitset.c +++ b/net/ethtool/bitset.c @@ -2,8 +2,9 @@ #include #include -#include "netlink.h" + #include "bitset.h" +#include "netlink.h" /* Some bitmaps are internally represented as an array of unsigned long, some * as an array of u32 (some even as single u32 for now). To avoid the need of diff --git a/net/ethtool/bitset.h b/net/ethtool/bitset.h index c2c2e0051d004..07bc547d47a87 100644 --- a/net/ethtool/bitset.h +++ b/net/ethtool/bitset.h @@ -3,6 +3,9 @@ #ifndef _NET_ETHTOOL_BITSET_H #define _NET_ETHTOOL_BITSET_H +#include +#include + #define ETHNL_MAX_BITSET_SIZE S16_MAX typedef const char (*const ethnl_string_array_t)[ETH_GSTRING_LEN]; diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c index 0364b8fb577bc..8d375dac2a406 100644 --- a/net/ethtool/cabletest.c +++ b/net/ethtool/cabletest.c @@ -3,8 +3,9 @@ #include #include #include -#include "netlink.h" + #include "common.h" +#include "netlink.h" /* 802.3 standard allows 100 meters for BaseT cables. However longer * cables might work, depending on the quality of the cables and the diff --git a/net/ethtool/channels.c b/net/ethtool/channels.c index ca4f80282448b..45232cf1c144c 100644 --- a/net/ethtool/channels.c +++ b/net/ethtool/channels.c @@ -2,8 +2,8 @@ #include -#include "netlink.h" #include "common.h" +#include "netlink.h" struct channels_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/coalesce.c b/net/ethtool/coalesce.c index 349bb02c517a3..1e2c5c7048a83 100644 --- a/net/ethtool/coalesce.c +++ b/net/ethtool/coalesce.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only #include -#include "netlink.h" + #include "common.h" +#include "netlink.h" struct coalesce_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/common.c b/net/ethtool/common.c index e252cf20c22f5..6a4a3797a8127 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -8,8 +8,8 @@ #include #include -#include "netlink.h" #include "common.h" +#include "netlink.h" #include "../core/dev.h" diff --git a/net/ethtool/debug.c b/net/ethtool/debug.c index 0b2dea56d4617..6043916b440e0 100644 --- a/net/ethtool/debug.c +++ b/net/ethtool/debug.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct debug_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/eee.c b/net/ethtool/eee.c index bf398973eb8a0..50d6fcd3661b1 100644 --- a/net/ethtool/eee.c +++ b/net/ethtool/eee.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct eee_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/eeprom.c b/net/ethtool/eeprom.c index 3b8209e930fd3..caf1e41e676b5 100644 --- a/net/ethtool/eeprom.c +++ b/net/ethtool/eeprom.c @@ -2,8 +2,9 @@ #include #include -#include "netlink.h" + #include "common.h" +#include "netlink.h" struct eeprom_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/features.c b/net/ethtool/features.c index f2217983be2bd..d9455b30aec93 100644 --- a/net/ethtool/features.c +++ b/net/ethtool/features.c @@ -2,9 +2,9 @@ #include -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct features_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/fec.c b/net/ethtool/fec.c index 4669e74cbcaaa..e2d5392710606 100644 --- a/net/ethtool/fec.c +++ b/net/ethtool/fec.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct fec_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index ff4b4780d6af4..11dfbf076b6d3 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -33,6 +33,7 @@ #include #include #include + #include "common.h" /* State held across locks and calls for commands which have devlink fallback */ diff --git a/net/ethtool/linkinfo.c b/net/ethtool/linkinfo.c index 30b8ce2751594..244ff92e2ff90 100644 --- a/net/ethtool/linkinfo.c +++ b/net/ethtool/linkinfo.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" #include "common.h" +#include "netlink.h" struct linkinfo_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c index 259cd9ef1f2a1..30d703531652b 100644 --- a/net/ethtool/linkmodes.c +++ b/net/ethtool/linkmodes.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" /* LINKMODES_GET */ diff --git a/net/ethtool/linkstate.c b/net/ethtool/linkstate.c index 05a5f72c99fab..8a5985fd77123 100644 --- a/net/ethtool/linkstate.c +++ b/net/ethtool/linkstate.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include #include +#include "common.h" +#include "netlink.h" + struct linkstate_req_info { struct ethnl_req_info base; }; diff --git a/net/ethtool/module.c b/net/ethtool/module.c index 0a761bf4771e1..cad2eb25b5a41 100644 --- a/net/ethtool/module.c +++ b/net/ethtool/module.c @@ -6,10 +6,10 @@ #include #include -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" #include "module_fw.h" +#include "netlink.h" struct module_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/mse.c b/net/ethtool/mse.c index 8cb3fc5e7be4f..e91b74430f763 100644 --- a/net/ethtool/mse.c +++ b/net/ethtool/mse.c @@ -4,8 +4,8 @@ #include #include -#include "netlink.h" #include "common.h" +#include "netlink.h" /* Channels A-D only; WORST and LINK are exclusive alternatives */ #define PHY_MSE_CHANNEL_COUNT 4 diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index 6e5f0f4f815a1..14cb06ec5171d 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -6,8 +6,9 @@ #include #include #include -#include "netlink.h" + #include "module_fw.h" +#include "netlink.h" static struct genl_family ethtool_genl_family; diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c index 5d28f642764c3..29f812e935b6f 100644 --- a/net/ethtool/pause.c +++ b/net/ethtool/pause.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" #include "common.h" +#include "netlink.h" struct pause_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/phc_vclocks.c b/net/ethtool/phc_vclocks.c index cadaabed60bd9..15146e38ab271 100644 --- a/net/ethtool/phc_vclocks.c +++ b/net/ethtool/phc_vclocks.c @@ -2,8 +2,8 @@ /* * Copyright 2021 NXP */ -#include "netlink.h" #include "common.h" +#include "netlink.h" struct phc_vclocks_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/phy.c b/net/ethtool/phy.c index 68372bef4b2fe..d4e6887055ab1 100644 --- a/net/ethtool/phy.c +++ b/net/ethtool/phy.c @@ -3,14 +3,14 @@ * Copyright 2023 Bootlin * */ -#include "common.h" -#include "netlink.h" - #include #include #include #include +#include "common.h" +#include "netlink.h" + struct phy_req_info { struct ethnl_req_info base; }; diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c index e1f7820a6158f..91f0c42332984 100644 --- a/net/ethtool/plca.c +++ b/net/ethtool/plca.c @@ -3,8 +3,8 @@ #include #include -#include "netlink.h" #include "common.h" +#include "netlink.h" struct plca_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/privflags.c b/net/ethtool/privflags.c index 297be6a13ab9a..46a4d2a43ba80 100644 --- a/net/ethtool/privflags.c +++ b/net/ethtool/privflags.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct privflags_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/pse-pd.c b/net/ethtool/pse-pd.c index 24def9c9dd54b..2eb9bdc2dcb90 100644 --- a/net/ethtool/pse-pd.c +++ b/net/ethtool/pse-pd.c @@ -6,14 +6,15 @@ // Copyright (c) 2022 Pengutronix, Oleksij Rempel // -#include "common.h" -#include "linux/pse-pd/pse.h" -#include "netlink.h" #include #include #include #include +#include "common.h" +#include "linux/pse-pd/pse.h" +#include "netlink.h" + struct pse_req_info { struct ethnl_req_info base; }; diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c index aeedd5ec6b8cd..0fd5dcc3729f8 100644 --- a/net/ethtool/rings.c +++ b/net/ethtool/rings.c @@ -2,8 +2,8 @@ #include -#include "netlink.h" #include "common.h" +#include "netlink.h" struct rings_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/rss.c b/net/ethtool/rss.c index da5934cceb075..0f4e5cd2ac71a 100644 --- a/net/ethtool/rss.c +++ b/net/ethtool/rss.c @@ -2,8 +2,8 @@ #include -#include "netlink.h" #include "common.h" +#include "netlink.h" struct rss_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/stats.c b/net/ethtool/stats.c index 3ca8eb2a3b314..38136f19b2eca 100644 --- a/net/ethtool/stats.c +++ b/net/ethtool/stats.c @@ -3,9 +3,9 @@ #include #include -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct stats_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c index f6a67109beda1..aa1e50c98f348 100644 --- a/net/ethtool/strset.c +++ b/net/ethtool/strset.c @@ -2,8 +2,9 @@ #include #include -#include "netlink.h" + #include "common.h" +#include "netlink.h" struct strset_info { bool per_dev; diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c index e49e612a68c2c..e4f518e49d4cb 100644 --- a/net/ethtool/tsconfig.c +++ b/net/ethtool/tsconfig.c @@ -3,11 +3,11 @@ #include #include -#include "netlink.h" -#include "common.h" #include "bitset.h" -#include "../core/dev.h" +#include "common.h" +#include "netlink.h" #include "ts.h" +#include "../core/dev.h" struct tsconfig_req_info { struct ethnl_req_info base; diff --git a/net/ethtool/tsinfo.c b/net/ethtool/tsinfo.c index c0145c752d2f8..9aad62695dfb3 100644 --- a/net/ethtool/tsinfo.c +++ b/net/ethtool/tsinfo.c @@ -6,9 +6,9 @@ #include #include -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" #include "ts.h" struct tsinfo_req_info { diff --git a/net/ethtool/wol.c b/net/ethtool/wol.c index a39d8000d808a..60f9a1d8535e2 100644 --- a/net/ethtool/wol.c +++ b/net/ethtool/wol.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "netlink.h" -#include "common.h" #include "bitset.h" +#include "common.h" +#include "netlink.h" struct wol_req_info { struct ethnl_req_info base;