]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: fspi: Logical or used instead of logical and
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 12 Aug 2025 16:42:59 +0000 (17:42 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 28 Oct 2025 16:33:00 +0000 (10:33 -0600)
In erratum_err050568 the test for apllicability uses logical or to check
multiple chip IDs but this means the test will always evaluate to true
as at least 1 term will always be true. Logical and should have been
used so that the expression evaluates to true if all terms are true
which would mean that no chip ID of interest was in use.

This issue was found by Smatch.

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

index 7086a2a264ab1cf8a68f1b04efddfed2205a74c2..46de915c238efbf491121d3f7b11fc11abcaebaf 100644 (file)
@@ -882,9 +882,9 @@ static void erratum_err050568(struct nxp_fspi *f)
 
        /* Check for LS1028A variants */
        svr = SVR_SOC_VER(get_svr());
-       if (svr != SVR_LS1017A ||
-           svr != SVR_LS1018A ||
-           svr != SVR_LS1027A ||
+       if (svr != SVR_LS1017A &&
+           svr != SVR_LS1018A &&
+           svr != SVR_LS1027A &&
            svr != SVR_LS1028A) {
                dev_dbg(f->dev, "Errata applicable only for LS1028A variants\n");
                return;