From: Kees Cook <kees@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Andrew Lunn <andrew@lunn.ch>,
"Kory Maincent (Dent Project)" <kory.maincent@bootlin.com>,
Michael Chan <michael.chan@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Potnuri Bharat Teja <bharat@chelsio.com>,
Christian Benvenuti <benve@cisco.com>,
Satish Kharat <satishkh@cisco.com>,
Manish Chopra <manishc@marvell.com>,
Simon Horman <horms@kernel.org>,
Edward Cree <ecree.xilinx@gmail.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Ahmed Zaki <ahmed.zaki@intel.com>,
Rahul Rameshbabu <rrameshbabu@nvidia.com>,
Ido Schimmel <idosch@nvidia.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Takeru Hayasaka <hayatake396@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: [PATCH 2/3] Revert "UAPI: ethtool: Use __struct_group() in struct ethtool_link_settings"
Date: Fri, 15 Nov 2024 12:43:04 -0800 [thread overview]
Message-ID: <20241115204308.3821419-2-kees@kernel.org> (raw)
In-Reply-To: <20241115204115.work.686-kees@kernel.org>
This reverts commit 43d3487035e9a86fad952de4240a518614240d43. We cannot
use tagged struct groups in UAPI because C++ will throw syntax errors
even under "extern C".
Signed-off-by: Kees Cook <kees@kernel.org>
---
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
---
include/uapi/linux/ethtool.h | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index fc1f54b065f9..c405ed63acfa 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -2511,24 +2511,21 @@ enum ethtool_reset_flags {
* autonegotiation; 0 if unknown or not applicable. Read-only.
*/
struct ethtool_link_settings {
- /* New members MUST be added within the __struct_group() macro below. */
- __struct_group(ethtool_link_settings_hdr, hdr, /* no attrs */,
- __u32 cmd;
- __u32 speed;
- __u8 duplex;
- __u8 port;
- __u8 phy_address;
- __u8 autoneg;
- __u8 mdio_support;
- __u8 eth_tp_mdix;
- __u8 eth_tp_mdix_ctrl;
- __s8 link_mode_masks_nwords;
- __u8 transceiver;
- __u8 master_slave_cfg;
- __u8 master_slave_state;
- __u8 rate_matching;
- __u32 reserved[7];
- );
+ __u32 cmd;
+ __u32 speed;
+ __u8 duplex;
+ __u8 port;
+ __u8 phy_address;
+ __u8 autoneg;
+ __u8 mdio_support;
+ __u8 eth_tp_mdix;
+ __u8 eth_tp_mdix_ctrl;
+ __s8 link_mode_masks_nwords;
+ __u8 transceiver;
+ __u8 master_slave_cfg;
+ __u8 master_slave_state;
+ __u8 rate_matching;
+ __u32 reserved[7];
__u32 link_mode_masks[];
/* layout of link_mode_masks fields:
* __u32 map_supported[link_mode_masks_nwords];
--
2.34.1
next prev parent reply other threads:[~2024-11-15 20:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 20:43 [PATCH 0/3] UAPI: ethtool: Avoid flex-array in struct ethtool_link_settings Kees Cook
2024-11-15 20:43 ` [PATCH 1/3] Revert "net: ethtool: Avoid thousands of -Wflex-array-member-not-at-end warnings" Kees Cook
2024-11-15 20:43 ` Kees Cook [this message]
2024-11-15 20:43 ` [PATCH 3/3] UAPI: ethtool: Avoid flex-array in struct ethtool_link_settings Kees Cook
2024-11-15 21:50 ` Jakub Kicinski
2024-11-19 4:00 ` [PATCH 0/3] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241115204308.3821419-2-kees@kernel.org \
--to=kees@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=benve@cisco.com \
--cc=bharat@chelsio.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=gustavoars@kernel.org \
--cc=hayatake396@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.com \
--cc=maxime.chevallier@bootlin.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rrameshbabu@nvidia.com \
--cc=satishkh@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.