net: mv88e6xxx: Fix logical operator instead of bitwise
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 11:14:14 +0000 (12:14 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 13:47:57 +0000 (15:47 +0200)
In mv88e6xxx_port_enable when attempting to mask out the previous
settings of two bits a logical operator was used instead of a bitwise
operator. Fix this.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/mv88e6xxx.c

index 557b6b2..f06c73c 100644 (file)
@@ -631,7 +631,7 @@ static int mv88e6xxx_port_enable(struct udevice *dev, int port, struct phy_devic
                        dev_dbg(dev, "configure internal RGMII delays\n");
 
                        /* RGMII delays */
-                       val &= ~(PORT_REG_PHYS_CTRL_RGMII_DELAY_RXCLK ||
+                       val &= ~(PORT_REG_PHYS_CTRL_RGMII_DELAY_RXCLK |
                                 PORT_REG_PHYS_CTRL_RGMII_DELAY_TXCLK);
                        if (phy->interface == PHY_INTERFACE_MODE_RGMII_ID ||
                            phy->interface == PHY_INTERFACE_MODE_RGMII_RXID)