Skip to content

Commit 82a5852

Browse files
minimaxwellkuba-moo
authored andcommitted
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>
1 parent e783e40 commit 82a5852

31 files changed

Lines changed: 58 additions & 46 deletions

net/ethtool/bitset.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
#include <linux/ethtool_netlink.h>
44
#include <linux/bitmap.h>
5-
#include "netlink.h"
5+
66
#include "bitset.h"
7+
#include "netlink.h"
78

89
/* Some bitmaps are internally represented as an array of unsigned long, some
910
* as an array of u32 (some even as single u32 for now). To avoid the need of

net/ethtool/bitset.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#ifndef _NET_ETHTOOL_BITSET_H
44
#define _NET_ETHTOOL_BITSET_H
55

6+
#include <linux/ethtool.h>
7+
#include <linux/netlink.h>
8+
69
#define ETHNL_MAX_BITSET_SIZE S16_MAX
710

811
typedef const char (*const ethnl_string_array_t)[ETH_GSTRING_LEN];

net/ethtool/cabletest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
#include <linux/phy.h>
44
#include <linux/ethtool_netlink.h>
55
#include <net/netdev_lock.h>
6-
#include "netlink.h"
6+
77
#include "common.h"
8+
#include "netlink.h"
89

910
/* 802.3 standard allows 100 meters for BaseT cables. However longer
1011
* cables might work, depending on the quality of the cables and the

net/ethtool/channels.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <net/xdp_sock_drv.h>
44

5-
#include "netlink.h"
65
#include "common.h"
6+
#include "netlink.h"
77

88
struct channels_req_info {
99
struct ethnl_req_info base;

net/ethtool/coalesce.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22

33
#include <linux/dim.h>
4-
#include "netlink.h"
4+
55
#include "common.h"
6+
#include "netlink.h"
67

78
struct coalesce_req_info {
89
struct ethnl_req_info base;

net/ethtool/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <linux/phy_link_topology.h>
99
#include <net/netdev_queues.h>
1010

11-
#include "netlink.h"
1211
#include "common.h"
12+
#include "netlink.h"
1313
#include "../core/dev.h"
1414

1515

net/ethtool/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22

3-
#include "netlink.h"
4-
#include "common.h"
53
#include "bitset.h"
4+
#include "common.h"
5+
#include "netlink.h"
66

77
struct debug_req_info {
88
struct ethnl_req_info base;

net/ethtool/eee.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22

3-
#include "netlink.h"
4-
#include "common.h"
53
#include "bitset.h"
4+
#include "common.h"
5+
#include "netlink.h"
66

77
struct eee_req_info {
88
struct ethnl_req_info base;

net/ethtool/eeprom.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
#include <linux/ethtool.h>
44
#include <linux/sfp.h>
5-
#include "netlink.h"
5+
66
#include "common.h"
7+
#include "netlink.h"
78

89
struct eeprom_req_info {
910
struct ethnl_req_info base;

net/ethtool/features.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#include <net/netdev_lock.h>
44

5-
#include "netlink.h"
6-
#include "common.h"
75
#include "bitset.h"
6+
#include "common.h"
7+
#include "netlink.h"
88

99
struct features_req_info {
1010
struct ethnl_req_info base;

0 commit comments

Comments
 (0)