[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230323165825.1588629-1-harshit.m.mogalapalli@oracle.com>
Date: Thu, 23 Mar 2023 09:58:25 -0700
From: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To: unlisted-recipients:; (no To-header on input)
Cc: error27@...il.com,
Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
James Schulman <james.schulman@...rus.com>,
David Rhodes <david.rhodes@...rus.com>,
Lucas Tanure <tanureal@...nsource.cirrus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Simon Trimmer <simont@...nsource.cirrus.com>,
alsa-devel@...a-project.org, patches@...nsource.cirrus.com,
linux-kernel@...r.kernel.org
Subject: [PATCH next] ASoC: cs35l56: Fix unsigned 'rv' comparison with zero in cs35l56_irq()
'rv' is of type unsigned int, which can never be less than zero.
rv = pm_runtime_resume_and_get(cs35l56->dev);
if (rv < 0) { // can never be true.
...
}
As pm_runtime_resume_and_get returns integers, change the type of 'rv'
to int to fix this.
This is found by static analysis with smatch.
Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
---
Only compile tested.
---
sound/soc/codecs/cs35l56.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index 90fc79b5666d..b3772005668a 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -321,7 +321,8 @@ irqreturn_t cs35l56_irq(int irq, void *data)
struct cs35l56_private *cs35l56 = data;
unsigned int status1 = 0, status8 = 0, status20 = 0;
unsigned int mask1, mask8, mask20;
- unsigned int rv, val;
+ unsigned int val;
+ int rv;
irqreturn_t ret = IRQ_NONE;
if (!cs35l56->init_done)
--
2.38.1
Powered by blists - more mailing lists