Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs35l56: Fix an unsigned comparison which can never be negative

The variable 'rv' is defined as unsigned type, so the following if
statement is invalid, we can modify the type of rv to int.
if (rv < 0) {
dev_err(cs35l56->dev, "irq: failed to get pm_runtime:
%d\n", rv);
goto err_unlock;
}

./sound/soc/codecs/cs35l56.c:333:5-7: WARNING: Unsigned expression compared with zero: rv < 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4599
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230324022303.121485-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jiapeng Chong and committed by
Mark Brown
ab76c891 92405802

+3 -1
+3 -1
sound/soc/codecs/cs35l56.c
··· 321 321 struct cs35l56_private *cs35l56 = data; 322 322 unsigned int status1 = 0, status8 = 0, status20 = 0; 323 323 unsigned int mask1, mask8, mask20; 324 - unsigned int rv, val; 324 + unsigned int val; 325 + int rv; 326 + 325 327 irqreturn_t ret = IRQ_NONE; 326 328 327 329 if (!cs35l56->init_done)