lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47a7ad5b-aa12-1eb9-2556-a00793d01181@gmail.com>
Date:   Sun, 19 Dec 2021 12:06:26 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     luizluca@...il.com, netdev@...r.kernel.org
Cc:     linus.walleij@...aro.org, andrew@...n.ch, vivien.didelot@...il.com,
        olteanv@...il.com, alsi@...g-olufsen.dk, arinc.unal@...nc9.com
Subject: Re: [PATCH net-next 11/13] net: dsa: realtek: rtl8367c: use
 GENMASK(n-1,0) instead of BIT(n)-1



On 12/16/2021 12:13 PM, luizluca@...il.com wrote:
> From: Luiz Angelo Daros de Luca <luizluca@...il.com>
> 
> Tested-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@...il.com>
> ---
>   drivers/net/dsa/realtek/rtl8367c.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dsa/realtek/rtl8367c.c b/drivers/net/dsa/realtek/rtl8367c.c
> index 6aca48165d1f..f370ea948c59 100644
> --- a/drivers/net/dsa/realtek/rtl8367c.c
> +++ b/drivers/net/dsa/realtek/rtl8367c.c
> @@ -1955,7 +1955,7 @@ static int rtl8367c_detect(struct realtek_priv *priv)
>   		mb->priv = priv;
>   		mb->chip_id = chip_id;
>   		mb->chip_ver = chip_ver;
> -		mb->port_mask = BIT(priv->num_ports) - 1;
> +		mb->port_mask = GENMASK(priv->num_ports-1,0);

Missing spaces between priv->num_ports, and -1 here, and the comma 
before 0 as well:
		mb->port_mask = GENMASK(priv->num_ports - 1, 0);

is what we would expect to see.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ