]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net/ethtool: drop duplicate TSCONFIG HWTSTAMP BUILD_BUG_ON from SET handler
authorChenguang Zhao <zhaochenguang@kylinos.cn>
Fri, 15 May 2026 03:25:50 +0000 (11:25 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 May 2026 13:15:12 +0000 (15:15 +0200)
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>
Link: https://patch.msgid.link/20260515032550.138572-1-zhaochenguang@kylinos.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ethtool/tsconfig.c

index e4f518e49d4cb01d620c2949cfa91dd9785f5b8e..239bbf2d826c36c7eaa94941b22bfd3fb6b63951 100644 (file)
@@ -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;