netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,  Simon Horman <horms@kernel.org>,
	Donald Hunter <donald.hunter@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	 Kory Maincent <kory.maincent@bootlin.com>
Subject: [PATCH net 2/3] net: ethtool: tsconfig: Fix ts filters and types enums size check
Date: Tue, 28 Jan 2025 16:35:47 +0100	[thread overview]
Message-ID: <20250128-fix_tsconfig-v1-2-87adcdc4e394@bootlin.com> (raw)
In-Reply-To: <20250128-fix_tsconfig-v1-0-87adcdc4e394@bootlin.com>

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@bootlin.com>
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


  parent reply	other threads:[~2025-01-28 15:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 15:35 [PATCH net 0/3] net: ethtool: timestamping: Fix small issues in the new uAPI Kory Maincent
2025-01-28 15:35 ` [PATCH net 1/3] MAINTAINERS: Add myself as maintainer for socket timestamping and expand file list Kory Maincent
2025-01-30  0:39   ` Jakub Kicinski
2025-01-30  9:18     ` Kory Maincent
2025-01-30 16:31       ` Jakub Kicinski
2025-01-30 16:56         ` Kory Maincent
2025-01-28 15:35 ` Kory Maincent [this message]
2025-01-30  0:45   ` [PATCH net 2/3] net: ethtool: tsconfig: Fix ts filters and types enums size check Jakub Kicinski
2025-01-30  9:24     ` Kory Maincent
2025-01-30 16:42       ` Jakub Kicinski
2025-01-28 15:35 ` [PATCH net 3/3] net: ethtool: tsconfig: Fix netlink type of hwtstamp flags Kory Maincent
2025-01-30  0:49   ` Jakub Kicinski
2025-01-30  9:27     ` Kory Maincent
2025-01-30 16:43       ` Jakub Kicinski

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=20250128-fix_tsconfig-v1-2-87adcdc4e394@bootlin.com \
    --to=kory.maincent@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=willemdebruijn.kernel@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).