]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: ulpi: Incorrect operator used
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 30 Sep 2025 16:06:44 +0000 (17:06 +0100)
committerMarek Vasut <marek.vasut+usb@mailbox.org>
Tue, 28 Oct 2025 15:33:15 +0000 (16:33 +0100)
Combining two bits into a mask to be used so that the same write code
can be used to set or reset bits in a register clearly needs to use the
binary 'or' operator, not the binary 'and'. Fix it.

This issue was found by Smatch.

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

index 128adcbde134bc5a3b3705c3ddd932b540b54cd4..0e0f0e4983d33583aa6d3212ccffc9db9ab3bc29 100644 (file)
@@ -127,7 +127,7 @@ int ulpi_set_vbus_indicator(struct ulpi_viewport *ulpi_vp, int external,
        if (val == ULPI_ERROR)
                return val;
 
-       val = val & ~(ULPI_IFACE_PASSTHRU & ULPI_IFACE_EXTVBUS_COMPLEMENT);
+       val = val & ~(ULPI_IFACE_PASSTHRU | ULPI_IFACE_EXTVBUS_COMPLEMENT);
        val |= flags;
        val = ulpi_write(ulpi_vp, &ulpi->iface_ctrl, val);
        if (val)