soundwire: qcom: Fix a u8 comparison with less than zero
PATCH 1/1 soundwire: qcom: Fix a u8 comparison with less than zero
From: Colin Ian King <[email protected]>
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")
--- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/qcom.c +1 -1
@@ -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);
Signature · 1 line
2.30.2
Quoted 11 lines · Colin King
From: Colin Ian King <[email protected]>
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 <[email protected]>
Quoted 20 lines
--- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/soundwire/qcom.c +1
-1@@ -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);Signature · 1 line
2.30.2
This patch was applied to qcom/linux.git (refs/heads/for-next):
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
Quoted 9 lines · On Wed, 31 Mar 2021 15:09:44 +0100 you wrote:
From: Colin Ian King <[email protected]>
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.
[...]
Here is the summary with links:
- [next] soundwire: qcom: Fix a u8 comparison with less than zero
https://git.kernel.org/qcom/c/b26b48749b18
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html