Thread (24 messages) 24 messages, 6 authors, 2026-09-09

RE: [PATCH 2/9] linkmode: make linkmode_and() return boolean

flat view

From: Loktionov, Aleksandr <hidden>
Date: 2026-09-08 13:04:28
Also in: intel-wired-lan, linux-usb, lkml

quoted hunk ↗ jump to hunk
-----Original Message-----
From: Yury Norov <yury.norov@gmail.com>
Sent: Monday, September 7, 2026 11:55 PM
To: Andrew Lunn <andrew@lunn.ch>; Heiner Kallweit
[off-list ref]; Russell King [off-list ref]; Raju
Rangoju [off-list ref]; Prashanth Kumar K R
[off-list ref]; Nguyen, Anthony L
[off-list ref]; Kitszel, Przemyslaw
[off-list ref]; Jian Shen [off-list ref];
Jijie Shao [off-list ref]; David S. Miller
[off-list ref]; Eric Dumazet [off-list ref]; Jakub
Kicinski [off-list ref]; Paolo Abeni [off-list ref]; linux-
kernel@vger.kernel.org; netdev@vger.kernel.org; intel-wired-
lan@lists.osuosl.org; linux-usb@vger.kernel.org
Cc: Yury Norov <redacted>; Yury Norov <yury.norov@gmail.com>;
Rasmus Villemoes [off-list ref]; Andrew Morton
[off-list ref]
Subject: [PATCH 2/9] linkmode: make linkmode_and() return boolean

bitmap_and() returns true if the resulting bitmap is not empty.
Propagate that return value through linkmode_and() so callers can use
it where applicable.

Signed-off-by: Yury Norov <redacted>
---
 include/linux/linkmode.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/linkmode.h b/include/linux/linkmode.h index
3b9de09871f6..c08632c10c3d 100644
--- a/include/linux/linkmode.h
+++ b/include/linux/linkmode.h
@@ -20,10 +20,10 @@ static inline void linkmode_copy(unsigned long
*dst, const unsigned long *src)
 	bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);  }

-static inline void linkmode_and(unsigned long *dst, const unsigned
long *a,
+static inline bool linkmode_and(unsigned long *dst, const unsigned
long
+*a,
 				const unsigned long *b)
 {
-	bitmap_and(dst, a, b, __ETHTOOL_LINK_MODE_MASK_NBITS);
+	return bitmap_and(dst, a, b, __ETHTOOL_LINK_MODE_MASK_NBITS);
 }

 static inline void linkmode_or(unsigned long *dst, const unsigned
long *a,
--
2.53.0
Reviewed-by: Aleksandr Loktionov <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help