diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-06-18 06:07:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-20 20:27:01 +0300 |
commit | ddcbabf4404606fcc3edf6e48caa9707b33d3df4 (patch) | |
tree | 6f9e91bd49a5dfdda22a2688294ac8ec2613ced8 /drivers/net/dsa/mv88e6xxx/port.c | |
parent | da16349d7e46a168417bae8dab447bf866b5e77c (diff) | |
download | linux-ddcbabf4404606fcc3edf6e48caa9707b33d3df4.tar.xz |
net: dsa: mv88e6xxx: better IEEE Prio Mapping Table description
Kill the remaining shift macro in favor of calculating at compile time
its value from the more descriptive mask, which gives us a better
representation of the register layout.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/port.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/port.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c index 73d825e08be3..a7801f6668a5 100644 --- a/drivers/net/dsa/mv88e6xxx/port.c +++ b/drivers/net/dsa/mv88e6xxx/port.c @@ -12,6 +12,7 @@ * (at your option) any later version. */ +#include <linux/bitfield.h> #include <linux/if_bridge.h> #include <linux/phy.h> @@ -912,15 +913,13 @@ int mv88e6095_port_tag_remap(struct mv88e6xxx_chip *chip, int port) } static int mv88e6xxx_port_ieeepmt_write(struct mv88e6xxx_chip *chip, - int port, u16 table, - u8 pointer, u16 data) + int port, u16 table, u8 ptr, u16 data) { u16 reg; - reg = MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_UPDATE | - table | - (pointer << MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_POINTER_SHIFT) | - data; + reg = MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_UPDATE | table | + (ptr << __bf_shf(MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_PTR_MASK)) | + (data & MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_DATA_MASK); return mv88e6xxx_port_write(chip, port, MV88E6390_PORT_IEEE_PRIO_MAP_TABLE, reg); |