diff mbox series

[net-next,11/13] net: dsa: realtek: rtl8367c: use GENMASK(n-1,0) instead of BIT(n)-1

Message ID 20211216201342.25587-12-luizluca@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: realtek: MDIO interface and RTL8367S | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: kuba@kernel.org davem@davemloft.net
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch fail CHECK: spaces preferred around that '-' (ctx:VxV) ERROR: space required after that ',' (ctx:VxV)
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Luiz Angelo Daros de Luca Dec. 16, 2021, 8:13 p.m. UTC
From: Luiz Angelo Daros de Luca <luizluca@gmail.com>

Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
 drivers/net/dsa/realtek/rtl8367c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Dec. 18, 2021, 2:59 a.m. UTC | #1
On Thu, Dec 16, 2021 at 9:14 PM <luizluca@gmail.com> wrote:

> From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
>
> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Florian Fainelli Dec. 19, 2021, 8:06 p.m. UTC | #2
On 12/16/2021 12:13 PM, luizluca@gmail.com wrote:
> From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
> 
> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.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.
Luiz Angelo Daros de Luca Dec. 19, 2021, 8:28 p.m. UTC | #3
>
> 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.

v2 fixed that. Did I mess with v2 submission?

https://patchwork.kernel.org/project/netdevbpf/patch/20211218081425.18722-11-luizluca@gmail.com/

> --
> Florian
diff mbox series

Patch

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);
 		mb->learn_limit_max = RTL8367C_LEARN_LIMIT_MAX;
 		mb->jam_table = rtl8367c_init_jam_8367c;
 		mb->jam_size = ARRAY_SIZE(rtl8367c_init_jam_8367c);