* [PATCH V2] soundwire: qcom: use signed variable for error return
@ 2021-03-31 15:55 Vinod Koul
2021-03-31 16:16 ` Pierre-Louis Bossart
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vinod Koul @ 2021-03-31 15:55 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: Vinod Koul, Bjorn Andersson, Bard Liao, Pierre-Louis Bossart,
Sanyog Kale, linux-arm-msm, alsa-devel, linux-kernel,
kernel test robot
We get warning of using a unsigned variable being compared to less than
zero. The comparison is correct as it checks for errors from previous
call to qcom_swrm_get_alert_slave_dev_num(), so we should use a signed
variable here.
While at it, drop the superfluous initialization as well
drivers/soundwire/qcom.c: qcom_swrm_irq_handler() warn: impossible
condition '(devnum < 0) => (0-255 < 0)'
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
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.26.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V2] soundwire: qcom: use signed variable for error return
2021-03-31 15:55 [PATCH V2] soundwire: qcom: use signed variable for error return Vinod Koul
@ 2021-03-31 16:16 ` Pierre-Louis Bossart
2021-03-31 16:26 ` Bjorn Andersson
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
2 siblings, 0 replies; 4+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-31 16:16 UTC (permalink / raw)
To: Vinod Koul, Srinivas Kandagatla
Cc: Bjorn Andersson, Bard Liao, Sanyog Kale, linux-arm-msm,
alsa-devel, linux-kernel, kernel test robot
On 3/31/21 10:55 AM, Vinod Koul wrote:
> We get warning of using a unsigned variable being compared to less than
> zero. The comparison is correct as it checks for errors from previous
> call to qcom_swrm_get_alert_slave_dev_num(), so we should use a signed
> variable here.
>
> While at it, drop the superfluous initialization as well
>
> drivers/soundwire/qcom.c: qcom_swrm_irq_handler() warn: impossible
> condition '(devnum < 0) => (0-255 < 0)'
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.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);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] soundwire: qcom: use signed variable for error return
2021-03-31 15:55 [PATCH V2] soundwire: qcom: use signed variable for error return Vinod Koul
2021-03-31 16:16 ` Pierre-Louis Bossart
@ 2021-03-31 16:26 ` Bjorn Andersson
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2021-03-31 16:26 UTC (permalink / raw)
To: Vinod Koul
Cc: Srinivas Kandagatla, Bard Liao, Pierre-Louis Bossart,
Sanyog Kale, linux-arm-msm, alsa-devel, linux-kernel,
kernel test robot
On Wed 31 Mar 10:55 CDT 2021, Vinod Koul wrote:
> We get warning of using a unsigned variable being compared to less than
> zero. The comparison is correct as it checks for errors from previous
> call to qcom_swrm_get_alert_slave_dev_num(), so we should use a signed
> variable here.
>
> While at it, drop the superfluous initialization as well
>
> drivers/soundwire/qcom.c: qcom_swrm_irq_handler() warn: impossible
> condition '(devnum < 0) => (0-255 < 0)'
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 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.26.3
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] soundwire: qcom: use signed variable for error return
2021-03-31 15:55 [PATCH V2] soundwire: qcom: use signed variable for error return Vinod Koul
2021-03-31 16:16 ` Pierre-Louis Bossart
2021-03-31 16:26 ` Bjorn Andersson
@ 2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-05-26 19:03 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-arm-msm
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
On Wed, 31 Mar 2021 21:25:20 +0530 you wrote:
> We get warning of using a unsigned variable being compared to less than
> zero. The comparison is correct as it checks for errors from previous
> call to qcom_swrm_get_alert_slave_dev_num(), so we should use a signed
> variable here.
>
> While at it, drop the superfluous initialization as well
>
> [...]
Here is the summary with links:
- [V2] soundwire: qcom: use signed variable for error return
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-26 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 15:55 [PATCH V2] soundwire: qcom: use signed variable for error return Vinod Koul
2021-03-31 16:16 ` Pierre-Louis Bossart
2021-03-31 16:26 ` Bjorn Andersson
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).