756-v5.8-net-dsa-rtl8366-Pass-GENMASK-signed-bits.patch 977 B

123456789101112131415161718192021222324252627
  1. From 733993f502f254912b1415e13f73651d9f2e74ef Mon Sep 17 00:00:00 2001
  2. From: Andrew Lunn <[email protected]>
  3. Date: Sun, 5 Jul 2020 22:42:27 +0200
  4. Subject: [PATCH 1/5] net: dsa: rtl8366: Pass GENMASK() signed bits
  5. Oddly, GENMASK() requires signed bit numbers, so that it can compare
  6. them for < 0. If passed an unsigned type, we get warnings about the
  7. test never being true.
  8. Signed-off-by: Andrew Lunn <[email protected]>
  9. Reviewed-by: Florian Fainelli <[email protected]>
  10. Signed-off-by: David S. Miller <[email protected]>
  11. ---
  12. drivers/net/dsa/rtl8366.c | 2 +-
  13. 1 file changed, 1 insertion(+), 1 deletion(-)
  14. --- a/drivers/net/dsa/rtl8366.c
  15. +++ b/drivers/net/dsa/rtl8366.c
  16. @@ -311,7 +311,7 @@ int rtl8366_init_vlan(struct realtek_smi
  17. /* For the CPU port, make all ports members of this
  18. * VLAN.
  19. */
  20. - mask = GENMASK(smi->num_ports - 1, 0);
  21. + mask = GENMASK((int)smi->num_ports - 1, 0);
  22. else
  23. /* For all other ports, enable itself plus the
  24. * CPU port.