[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210331140944.1421940-1-colin.king@canonical.com>
Date: Wed, 31 Mar 2021 15:09:44 +0100
From: Colin King <colin.king@...onical.com>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Vinod Koul <vkoul@...nel.org>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Sanyog Kale <sanyog.r.kale@...el.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
linux-arm-msm@...r.kernel.org, alsa-devel@...a-project.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] soundwire: qcom: Fix a u8 comparison with less than zero
From: Colin Ian King <colin.king@...onical.com>
Variable devnum is being checked for a less than zero error return
however the comparison will always be false because devnum is an 8 bit
unsigned integer. Fix this by making devnum an int. Also there is no
need to iniitialize devnum with zero as this value is no read, so
remove the redundant assignment.
Addresses-Coverity: ("Unsigned compared against 0")
Fixes: c7d49c76d1d5 ("soundwire: qcom: add support to new interrupts")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/soundwire/qcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index b08ecb9b418c..ec86c4e53fdb 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -428,7 +428,7 @@ static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id)
struct qcom_swrm_ctrl *swrm = dev_id;
u32 value, intr_sts, intr_sts_masked, slave_status;
u32 i;
- u8 devnum = 0;
+ int devnum;
int ret = IRQ_HANDLED;
swrm->reg_read(swrm, SWRM_INTERRUPT_STATUS, &intr_sts);
--
2.30.2
Powered by blists - more mailing lists