RE: [PATCH 2/9] linkmode: make linkmode_and() return boolean
From: Loktionov, Aleksandr
Date: Tue Sep 08 2026 - 09:41:16 EST
> -----Original Message-----
> From: Yury Norov <yury.norov@xxxxxxxxx>
> Sent: Monday, September 7, 2026 11:55 PM
> To: Andrew Lunn <andrew@xxxxxxx>; Heiner Kallweit
> <hkallweit1@xxxxxxxxx>; Russell King <linux@xxxxxxxxxxxxxxx>; Raju
> Rangoju <Raju.Rangoju@xxxxxxx>; Prashanth Kumar K R
> <PrashanthKumar.K.R@xxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Jian Shen <shenjian15@xxxxxxxxxx>;
> Jijie Shao <shaojijie@xxxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; linux-
> kernel@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; intel-wired-
> lan@xxxxxxxxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx
> Cc: Yury Norov <ynorov@xxxxxxxxxx>; Yury Norov <yury.norov@xxxxxxxxx>;
> Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>; Andrew Morton
> <akpm@xxxxxxxxxxxxxxxxxxxx>
> 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@xxxxxxxxxx>
> ---
> 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@xxxxxxxxx>