Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <linux/ethtool.h> for
ETH_GSTRING_LEN, and <linux/netlink.h> 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 <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20260319180555.1531386-1-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Maxime Chevallier and committed by
Jakub Kicinski
82a58525 e783e40f

+58 -46
+2 -1
net/ethtool/bitset.c
··· 2 2 3 3 #include <linux/ethtool_netlink.h> 4 4 #include <linux/bitmap.h> 5 - #include "netlink.h" 5 + 6 6 #include "bitset.h" 7 + #include "netlink.h" 7 8 8 9 /* Some bitmaps are internally represented as an array of unsigned long, some 9 10 * as an array of u32 (some even as single u32 for now). To avoid the need of
+3
net/ethtool/bitset.h
··· 3 3 #ifndef _NET_ETHTOOL_BITSET_H 4 4 #define _NET_ETHTOOL_BITSET_H 5 5 6 + #include <linux/ethtool.h> 7 + #include <linux/netlink.h> 8 + 6 9 #define ETHNL_MAX_BITSET_SIZE S16_MAX 7 10 8 11 typedef const char (*const ethnl_string_array_t)[ETH_GSTRING_LEN];
+2 -1
net/ethtool/cabletest.c
··· 3 3 #include <linux/phy.h> 4 4 #include <linux/ethtool_netlink.h> 5 5 #include <net/netdev_lock.h> 6 - #include "netlink.h" 6 + 7 7 #include "common.h" 8 + #include "netlink.h" 8 9 9 10 /* 802.3 standard allows 100 meters for BaseT cables. However longer 10 11 * cables might work, depending on the quality of the cables and the
+1 -1
net/ethtool/channels.c
··· 2 2 3 3 #include <net/xdp_sock_drv.h> 4 4 5 - #include "netlink.h" 6 5 #include "common.h" 6 + #include "netlink.h" 7 7 8 8 struct channels_req_info { 9 9 struct ethnl_req_info base;
+2 -1
net/ethtool/coalesce.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 3 #include <linux/dim.h> 4 - #include "netlink.h" 4 + 5 5 #include "common.h" 6 + #include "netlink.h" 6 7 7 8 struct coalesce_req_info { 8 9 struct ethnl_req_info base;
+1 -1
net/ethtool/common.c
··· 8 8 #include <linux/phy_link_topology.h> 9 9 #include <net/netdev_queues.h> 10 10 11 - #include "netlink.h" 12 11 #include "common.h" 12 + #include "netlink.h" 13 13 #include "../core/dev.h" 14 14 15 15
+2 -2
net/ethtool/debug.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include "bitset.h" 4 + #include "common.h" 5 + #include "netlink.h" 6 6 7 7 struct debug_req_info { 8 8 struct ethnl_req_info base;
+2 -2
net/ethtool/eee.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include "bitset.h" 4 + #include "common.h" 5 + #include "netlink.h" 6 6 7 7 struct eee_req_info { 8 8 struct ethnl_req_info base;
+2 -1
net/ethtool/eeprom.c
··· 2 2 3 3 #include <linux/ethtool.h> 4 4 #include <linux/sfp.h> 5 - #include "netlink.h" 5 + 6 6 #include "common.h" 7 + #include "netlink.h" 7 8 8 9 struct eeprom_req_info { 9 10 struct ethnl_req_info base;
+2 -2
net/ethtool/features.c
··· 2 2 3 3 #include <net/netdev_lock.h> 4 4 5 - #include "netlink.h" 6 - #include "common.h" 7 5 #include "bitset.h" 6 + #include "common.h" 7 + #include "netlink.h" 8 8 9 9 struct features_req_info { 10 10 struct ethnl_req_info base;
+2 -2
net/ethtool/fec.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include "bitset.h" 4 + #include "common.h" 5 + #include "netlink.h" 6 6 7 7 struct fec_req_info { 8 8 struct ethnl_req_info base;
+1
net/ethtool/ioctl.c
··· 33 33 #include <net/flow_offload.h> 34 34 #include <net/netdev_lock.h> 35 35 #include <linux/ethtool_netlink.h> 36 + 36 37 #include "common.h" 37 38 38 39 /* State held across locks and calls for commands which have devlink fallback */
+1 -1
net/ethtool/linkinfo.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 3 #include "common.h" 4 + #include "netlink.h" 5 5 6 6 struct linkinfo_req_info { 7 7 struct ethnl_req_info base;
+2 -2
net/ethtool/linkmodes.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include "bitset.h" 4 + #include "common.h" 5 + #include "netlink.h" 6 6 7 7 /* LINKMODES_GET */ 8 8
+3 -2
net/ethtool/linkstate.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include <linux/phy.h> 6 4 #include <linux/phylib_stubs.h> 5 + 6 + #include "common.h" 7 + #include "netlink.h" 7 8 8 9 struct linkstate_req_info { 9 10 struct ethnl_req_info base;
+2 -2
net/ethtool/module.c
··· 6 6 #include <net/devlink.h> 7 7 #include <net/netdev_lock.h> 8 8 9 - #include "netlink.h" 10 - #include "common.h" 11 9 #include "bitset.h" 10 + #include "common.h" 12 11 #include "module_fw.h" 12 + #include "netlink.h" 13 13 14 14 struct module_req_info { 15 15 struct ethnl_req_info base;
+1 -1
net/ethtool/mse.c
··· 4 4 #include <linux/phy.h> 5 5 #include <linux/slab.h> 6 6 7 - #include "netlink.h" 8 7 #include "common.h" 8 + #include "netlink.h" 9 9 10 10 /* Channels A-D only; WORST and LINK are exclusive alternatives */ 11 11 #define PHY_MSE_CHANNEL_COUNT 4
+2 -1
net/ethtool/netlink.c
··· 6 6 #include <linux/ethtool_netlink.h> 7 7 #include <linux/phy_link_topology.h> 8 8 #include <linux/pm_runtime.h> 9 - #include "netlink.h" 9 + 10 10 #include "module_fw.h" 11 + #include "netlink.h" 11 12 12 13 static struct genl_family ethtool_genl_family; 13 14
+1 -1
net/ethtool/pause.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 3 #include "common.h" 4 + #include "netlink.h" 5 5 6 6 struct pause_req_info { 7 7 struct ethnl_req_info base;
+1 -1
net/ethtool/phc_vclocks.c
··· 2 2 /* 3 3 * Copyright 2021 NXP 4 4 */ 5 - #include "netlink.h" 6 5 #include "common.h" 6 + #include "netlink.h" 7 7 8 8 struct phc_vclocks_req_info { 9 9 struct ethnl_req_info base;
+3 -3
net/ethtool/phy.c
··· 3 3 * Copyright 2023 Bootlin 4 4 * 5 5 */ 6 - #include "common.h" 7 - #include "netlink.h" 8 - 9 6 #include <linux/phy.h> 10 7 #include <linux/phy_link_topology.h> 11 8 #include <linux/sfp.h> 12 9 #include <net/netdev_lock.h> 10 + 11 + #include "common.h" 12 + #include "netlink.h" 13 13 14 14 struct phy_req_info { 15 15 struct ethnl_req_info base;
+1 -1
net/ethtool/plca.c
··· 3 3 #include <linux/phy.h> 4 4 #include <linux/ethtool_netlink.h> 5 5 6 - #include "netlink.h" 7 6 #include "common.h" 7 + #include "netlink.h" 8 8 9 9 struct plca_req_info { 10 10 struct ethnl_req_info base;
+2 -2
net/ethtool/privflags.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include "bitset.h" 4 + #include "common.h" 5 + #include "netlink.h" 6 6 7 7 struct privflags_req_info { 8 8 struct ethnl_req_info base;
+4 -3
net/ethtool/pse-pd.c
··· 6 6 // Copyright (c) 2022 Pengutronix, Oleksij Rempel <kernel@pengutronix.de> 7 7 // 8 8 9 - #include "common.h" 10 - #include "linux/pse-pd/pse.h" 11 - #include "netlink.h" 12 9 #include <linux/ethtool_netlink.h> 13 10 #include <linux/ethtool.h> 14 11 #include <linux/export.h> 15 12 #include <linux/phy.h> 13 + 14 + #include "common.h" 15 + #include "linux/pse-pd/pse.h" 16 + #include "netlink.h" 16 17 17 18 struct pse_req_info { 18 19 struct ethnl_req_info base;
+1 -1
net/ethtool/rings.c
··· 2 2 3 3 #include <net/netdev_queues.h> 4 4 5 - #include "netlink.h" 6 5 #include "common.h" 6 + #include "netlink.h" 7 7 8 8 struct rings_req_info { 9 9 struct ethnl_req_info base;
+1 -1
net/ethtool/rss.c
··· 2 2 3 3 #include <net/netdev_lock.h> 4 4 5 - #include "netlink.h" 6 5 #include "common.h" 6 + #include "netlink.h" 7 7 8 8 struct rss_req_info { 9 9 struct ethnl_req_info base;
+2 -2
net/ethtool/stats.c
··· 3 3 #include <linux/phy.h> 4 4 #include <linux/phylib_stubs.h> 5 5 6 - #include "netlink.h" 7 - #include "common.h" 8 6 #include "bitset.h" 7 + #include "common.h" 8 + #include "netlink.h" 9 9 10 10 struct stats_req_info { 11 11 struct ethnl_req_info base;
+2 -1
net/ethtool/strset.c
··· 2 2 3 3 #include <linux/ethtool.h> 4 4 #include <linux/phy.h> 5 - #include "netlink.h" 5 + 6 6 #include "common.h" 7 + #include "netlink.h" 7 8 8 9 struct strset_info { 9 10 bool per_dev;
+3 -3
net/ethtool/tsconfig.c
··· 3 3 #include <linux/net_tstamp.h> 4 4 #include <linux/ptp_clock_kernel.h> 5 5 6 - #include "netlink.h" 7 - #include "common.h" 8 6 #include "bitset.h" 9 - #include "../core/dev.h" 7 + #include "common.h" 8 + #include "netlink.h" 10 9 #include "ts.h" 10 + #include "../core/dev.h" 11 11 12 12 struct tsconfig_req_info { 13 13 struct ethnl_req_info base;
+2 -2
net/ethtool/tsinfo.c
··· 6 6 #include <linux/ptp_clock_kernel.h> 7 7 #include <net/netdev_lock.h> 8 8 9 - #include "netlink.h" 10 - #include "common.h" 11 9 #include "bitset.h" 10 + #include "common.h" 11 + #include "netlink.h" 12 12 #include "ts.h" 13 13 14 14 struct tsinfo_req_info {
+2 -2
net/ethtool/wol.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 - #include "netlink.h" 4 - #include "common.h" 5 3 #include "bitset.h" 4 + #include "common.h" 5 + #include "netlink.h" 6 6 7 7 struct wol_req_info { 8 8 struct ethnl_req_info base;