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

Loktionov, Aleksandr aleksandr.loktionov at intel.com
Tue Sep 8 13:04:18 UTC 2026



> -----Original Message-----
> From: Yury Norov <yury.norov at gmail.com>
> Sent: Monday, September 7, 2026 11:55 PM
> To: Andrew Lunn <andrew at lunn.ch>; Heiner Kallweit
> <hkallweit1 at gmail.com>; Russell King <linux at armlinux.org.uk>; Raju
> Rangoju <Raju.Rangoju at amd.com>; Prashanth Kumar K R
> <PrashanthKumar.K.R at amd.com>; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel at intel.com>; Jian Shen <shenjian15 at huawei.com>;
> Jijie Shao <shaojijie at huawei.com>; David S. Miller
> <davem at davemloft.net>; Eric Dumazet <edumazet at google.com>; Jakub
> Kicinski <kuba at kernel.org>; Paolo Abeni <pabeni at redhat.com>; linux-
> kernel at vger.kernel.org; netdev at vger.kernel.org; intel-wired-
> lan at lists.osuosl.org; linux-usb at vger.kernel.org
> Cc: Yury Norov <ynorov at nvidia.com>; Yury Norov <yury.norov at gmail.com>;
> Rasmus Villemoes <linux at rasmusvillemoes.dk>; Andrew Morton
> <akpm at linux-foundation.org>
> 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 <ynorov at nvidia.com>
> ---
>  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 <aleksandr.loktionov at intel.com>


More information about the Intel-wired-lan mailing list