Netdev List
 help / color / mirror / Atom feed
* [net-next v2] net/ethtool: drop duplicate TSCONFIG HWTSTAMP BUILD_BUG_ON from SET handler
@ 2026-05-15  3:25 Chenguang Zhao
  2026-05-19 13:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Chenguang Zhao @ 2026-05-15  3:25 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman
  Cc: Chenguang Zhao, netdev, linux-kernel

BUILD_BUG_ON() is evaluated at compile time. The same three checks
for __HWTSTAMP_TX_CNT, __HWTSTAMP_FILTER_CNT and __HWTSTAMP_FLAG_CNT
are already present earlier in this file (tsconfig_reply_size()).
Repeating them at the start of ethnl_set_tsconfig() does not
strengthen the guarantee; remove the redundant block there and
keep a single occurrence.

Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
---
v2:
 - Drop redundant BUILD_BUG_ON checks as suggested by Paolo.
---
 net/ethtool/tsconfig.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c
index e4f518e49d4c..239bbf2d826c 100644
--- a/net/ethtool/tsconfig.c
+++ b/net/ethtool/tsconfig.c
@@ -302,10 +302,6 @@ static int ethnl_set_tsconfig(struct ethnl_req_info *req_base,
 	struct nlattr **tb = info->attrs;
 	int ret;
 
-	BUILD_BUG_ON(__HWTSTAMP_TX_CNT >= 32);
-	BUILD_BUG_ON(__HWTSTAMP_FILTER_CNT >= 32);
-	BUILD_BUG_ON(__HWTSTAMP_FLAG_CNT > 32);
-
 	if (!netif_device_present(dev))
 		return -ENODEV;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net-next v2] net/ethtool: drop duplicate TSCONFIG HWTSTAMP BUILD_BUG_ON from SET handler
  2026-05-15  3:25 [net-next v2] net/ethtool: drop duplicate TSCONFIG HWTSTAMP BUILD_BUG_ON from SET handler Chenguang Zhao
@ 2026-05-19 13:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-19 13:20 UTC (permalink / raw)
  To: Chenguang Zhao
  Cc: andrew, kuba, davem, edumazet, pabeni, horms, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 15 May 2026 11:25:50 +0800 you wrote:
> BUILD_BUG_ON() is evaluated at compile time. The same three checks
> for __HWTSTAMP_TX_CNT, __HWTSTAMP_FILTER_CNT and __HWTSTAMP_FLAG_CNT
> are already present earlier in this file (tsconfig_reply_size()).
> Repeating them at the start of ethnl_set_tsconfig() does not
> strengthen the guarantee; remove the redundant block there and
> keep a single occurrence.
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net/ethtool: drop duplicate TSCONFIG HWTSTAMP BUILD_BUG_ON from SET handler
    https://git.kernel.org/netdev/net-next/c/794cd1c77f53

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-19 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  3:25 [net-next v2] net/ethtool: drop duplicate TSCONFIG HWTSTAMP BUILD_BUG_ON from SET handler Chenguang Zhao
2026-05-19 13:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox