Commit f1931164 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: dsa: mv88e6xxx: Fix sparse warnings from GENMASK

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: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7680b8f1
...@@ -167,7 +167,7 @@ struct mv88e6xxx_irq { ...@@ -167,7 +167,7 @@ struct mv88e6xxx_irq {
u16 masked; u16 masked;
struct irq_chip chip; struct irq_chip chip;
struct irq_domain *domain; struct irq_domain *domain;
unsigned int nirqs; int nirqs;
}; };
/* state flags for mv88e6xxx_port_hwtstamp::state */ /* state flags for mv88e6xxx_port_hwtstamp::state */
...@@ -654,7 +654,7 @@ static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip) ...@@ -654,7 +654,7 @@ static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip)
static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip) static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip)
{ {
return GENMASK(mv88e6xxx_num_ports(chip) - 1, 0); return GENMASK((s32)mv88e6xxx_num_ports(chip) - 1, 0);
} }
static inline unsigned int mv88e6xxx_num_gpio(struct mv88e6xxx_chip *chip) static inline unsigned int mv88e6xxx_num_gpio(struct mv88e6xxx_chip *chip)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment