Message ID | 20200705204227.892335-1-andrew@lunn.ch |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | dsa: rtl8366: Pass GENMASK() signed bits | expand |
On 7/5/2020 1:42 PM, Andrew Lunn wrote: > Oddly, GENMASK() requires signed bit numbers, so that it can compare > them for < 0. If passed an unsigned type, we get warnings about the > test never being true. > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> The subject should also be prefixed with "net: " similar to the bcm_sf2 patches you just sent out, with that fixed: Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com> Date: Sun, 5 Jul 2020 13:49:10 -0700 > > > On 7/5/2020 1:42 PM, Andrew Lunn wrote: >> Oddly, GENMASK() requires signed bit numbers, so that it can compare >> them for < 0. If passed an unsigned type, we get warnings about the >> test never being true. >> >> Signed-off-by: Andrew Lunn <andrew@lunn.ch> > > The subject should also be prefixed with "net: " similar to the bcm_sf2 > patches you just sent out, with that fixed: > > Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Applied with Subject fixed.
On Sun, Jul 5, 2020 at 10:42 PM Andrew Lunn <andrew@lunn.ch> wrote: > Oddly, GENMASK() requires signed bit numbers, so that it can compare > them for < 0. If passed an unsigned type, we get warnings about the > test never being true. > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> I just resent my RTL8366RB series and I picked this patch in front of the series so as to make sure it applies. (I also took care to carry forward the same fix in the new code.) I hope there are no other collisions. Yours, Linus Walleij
diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c index ac88caca5ad4..993cf3ac59d9 100644 --- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -272,7 +272,7 @@ int rtl8366_init_vlan(struct realtek_smi *smi) /* For the CPU port, make all ports members of this * VLAN. */ - mask = GENMASK(smi->num_ports - 1, 0); + mask = GENMASK((int)smi->num_ports - 1, 0); else /* For all other ports, enable itself plus the * CPU port.
Oddly, GENMASK() requires signed bit numbers, so that it can compare them for < 0. If passed an unsigned type, we get warnings about the test never being true. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/dsa/rtl8366.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)