]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net: dsa: mv88e6xxx: fix SMI bit checking
authorVivien Didelot <vivien.didelot@gmail.com>
Fri, 9 Aug 2019 22:47:58 +0000 (18:47 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Aug 2019 04:27:15 +0000 (21:27 -0700)
The current mv88e6xxx_smi_direct_wait function is only used to check
the 16th bit of the (16-bit) SMI Command register. But the bit shift
operation is not enough if we eventually use this function to check
other bits, thus replace it with a mask.

Fixes: e7ba0fad9c53 ("net: dsa: mv88e6xxx: refine SMI support")
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/smi.c

index 5fc78a0638432056fe7e6d31762ad582b3cf0cfd..18e87a5a20a35c8e2c8f8fb2ff30d0535073691a 100644 (file)
@@ -64,7 +64,7 @@ static int mv88e6xxx_smi_direct_wait(struct mv88e6xxx_chip *chip,
                if (err)
                        return err;
 
-               if (!!(data >> bit) == !!val)
+               if (!!(data & BIT(bit)) == !!val)
                        return 0;
        }