]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sound: rt5677: Cannot test unsigned for being negative
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 12 Aug 2025 10:36:53 +0000 (11:36 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 19 Aug 2025 17:25:25 +0000 (11:25 -0600)
In rt5677_bic_or the call to rt5677_i2c_read returns an int so old
should also be an int to receive that value and then be able to test it
for being negative which would indicate an error.

This issue was found by Smatch.

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

index b5c997c6dd53407fd56c2113ca28f73c197efa22..a9d1e94951a55945b05198e98a2ccdc6de49d6fb 100644 (file)
@@ -94,8 +94,8 @@ static int rt5677_i2c_write(struct rt5677_priv *priv, uint reg, uint data)
 static int rt5677_bic_or(struct rt5677_priv *priv, uint reg, uint bic,
                         uint set)
 {
-       uint old, new_value;
-       int ret;
+       uint new_value;
+       int old, ret;
 
        old = rt5677_i2c_read(priv, reg);
        if (old < 0)