[PATCH net 2/3] net: ethtool: tsconfig: Fix ts filters and types enums size check
From: Kory Maincent
Date: Tue Jan 28 2025 - 10:36:34 EST
Fix the size check for the hwtstamp_tx_types and hwtstamp_rx_filters
enumerations. Align this check with the approach used in tsinfo for
consistency and correctness.
Signed-off-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
Fixes: 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")
---
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 9188e088fb2f..2dc3a3b76615 100644
--- a/net/ethtool/tsconfig.c
+++ b/net/ethtool/tsconfig.c
@@ -294,8 +294,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);
if (!netif_device_present(dev))
return -ENODEV;
--
2.34.1