net: dsa: mv88e6xxx: unconditionally set ATU trunk
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Tue, 28 Mar 2017 19:09:43 +0000 (15:09 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2017 05:04:51 +0000 (22:04 -0700)
Set the trunk member of the mv88e6xxx_atu_entry structure regardless its
value, so that uninitialized structures gets the correct boolean value.

Note that no mainline code is affected by the current behavior.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/global1_atu.c

index 120b7f41a73594d0b5ea8a02ba2c61c93e4d247b..492e00dea3cef1309c841b4fae5362dd59e882e5 100644 (file)
@@ -121,9 +121,7 @@ static int mv88e6xxx_g1_atu_data_read(struct mv88e6xxx_chip *chip,
 
        entry->state = val & 0xf;
        if (entry->state != GLOBAL_ATU_DATA_STATE_UNUSED) {
-               if (val & GLOBAL_ATU_DATA_TRUNK)
-                       entry->trunk = true;
-
+               entry->trunk = !!(val & GLOBAL_ATU_DATA_TRUNK);
                entry->portvec = (val >> 4) & mv88e6xxx_port_mask(chip);
        }