summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Goodbody <[email protected]>2025-08-12 11:36:53 +0100
committerTom Rini <[email protected]>2025-08-19 11:25:25 -0600
commitda938a4254b4cf9d4e7b894a0a30536b0d9266c5 (patch)
tree5edd5d37380871f704d6fd6dd1b07fd5d043f463
parent544bf0aa599f9afd8ac5224b005edd4b5bb374ed (diff)
sound: rt5677: Cannot test unsigned for being negative
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 <[email protected]>
-rw-r--r--drivers/sound/rt5677.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/sound/rt5677.c b/drivers/sound/rt5677.c
index b5c997c6dd5..a9d1e94951a 100644
--- a/drivers/sound/rt5677.c
+++ b/drivers/sound/rt5677.c
@@ -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)