Netdev List
 help / color / mirror / Atom feed
* [PATCH] ethtool: fix inverted memchr_inv condition in ethnl_bitmap32_not_zero()
@ 2026-05-08  8:02 Chenguang Zhao
  2026-05-08  9:13 ` Breno Leitao
  0 siblings, 1 reply; 2+ messages in thread
From: Chenguang Zhao @ 2026-05-08  8:02 UTC (permalink / raw)
  To: Andrew Lunn, Jakub Kicinski, David S. Miller, Eric Dumazet,
	Paolo Abeni
  Cc: Chenguang Zhao, Simon Horman, Maxime Chevallier, netdev

memchr_inv() returns non-NULL when a byte differs from the given value.
Return true in that case, not when the scanned words are all zero.

Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
---
 net/ethtool/bitset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/bitset.c b/net/ethtool/bitset.c
index 8bb98d3ea3db..56b0c4867ed2 100644
--- a/net/ethtool/bitset.c
+++ b/net/ethtool/bitset.c
@@ -105,7 +105,7 @@ static bool ethnl_bitmap32_not_zero(const u32 *map, unsigned int start,
 		start_word++;
 	}
 
-	if (!memchr_inv(map + start_word, '\0',
+	if (memchr_inv(map + start_word, '\0',
 			(end_word - start_word) * sizeof(u32)))
 		return true;
 	if (end % 32 == 0)
-- 
2.25.1


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

end of thread, other threads:[~2026-05-08  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08  8:02 [PATCH] ethtool: fix inverted memchr_inv condition in ethnl_bitmap32_not_zero() Chenguang Zhao
2026-05-08  9:13 ` Breno Leitao

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