BUILD_BUG_ON(__HWTSTAMP_TX_CNT >= 32) and the same for
__HWTSTAMP_FILTER_CNT reject the valid upper bound of
32 enum-derived bit positions in a u32 bitset (indices 0 .. 31).
Use > 32 so only counts strictly larger than the u32
width fail at compile time.
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
---
net/ethtool/tsconfig.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c
index e4f518e49d4c..bdf26352de2d 100644
--- a/net/ethtool/tsconfig.c
+++ b/net/ethtool/tsconfig.c
@@ -302,8 +302,8 @@ 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_TX_CNT > 32);
+ BUILD_BUG_ON(__HWTSTAMP_FILTER_CNT > 32);
BUILD_BUG_ON(__HWTSTAMP_FLAG_CNT > 32);
if (!netif_device_present(dev))
--
2.25.1