From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [vkoul-soundwire:next 33/36] drivers/soundwire/qcom.c:376 qcom_swrm_irq_handler() warn: impossible condition '(devnum < 0) => (0-255 < 0)'
Date: Wed, 31 Mar 2021 10:14:59 +0300 [thread overview]
Message-ID: <20210331071459.GE2088@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 3792 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git next
head: 06dd96738d618391ae58e1b28f1ba49fef214c95
commit: c7d49c76d1d5f5a41f637c18ce3b756351c7fdf9 [33/36] soundwire: qcom: add support to new interrupts
config: x86_64-randconfig-m001-20210330 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/soundwire/qcom.c:376 qcom_swrm_irq_handler() warn: impossible condition '(devnum < 0) => (0-255 < 0)'
vim +376 drivers/soundwire/qcom.c
02efb49aa805cee Srinivas Kandagatla 2020-01-13 356 static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 357 {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 358 struct qcom_swrm_ctrl *swrm = dev_id;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 359 u32 value, intr_sts, intr_sts_masked;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 360 u32 i;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 361 u8 devnum = 0;
^^^^^^^^^^^^^
no need to initalized devnum, btw.
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 362 int ret = IRQ_HANDLED;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 363
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 364 swrm->reg_read(swrm, SWRM_INTERRUPT_STATUS, &intr_sts);
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 365 intr_sts_masked = intr_sts & swrm->intr_mask;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 366
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 367 do {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 368 for (i = 0; i < SWRM_INTERRUPT_MAX; i++) {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 369 value = intr_sts_masked & BIT(i);
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 370 if (!value)
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 371 continue;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 372
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 373 switch (value) {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 374 case SWRM_INTERRUPT_STATUS_SLAVE_PEND_IRQ:
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 375 devnum = qcom_swrm_get_alert_slave_dev_num(swrm);
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 @376 if (devnum < 0) {
^^^^^^^^^^
"devnum" is a u8 so it can't be negative.
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 377 dev_err_ratelimited(swrm->dev,
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 378 "no slave alert found.spurious interrupt\n");
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 379 } else {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 380 sdw_handle_slave_status(&swrm->bus, swrm->status);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 381 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 382
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 383 break;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 384 case SWRM_INTERRUPT_STATUS_NEW_SLAVE_ATTACHED:
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 385 case SWRM_INTERRUPT_STATUS_CHANGE_ENUM_SLAVE_STATUS:
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 386 dev_err_ratelimited(swrm->dev, "%s: SWR new slave attached\n",
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45245 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [kbuild] [vkoul-soundwire:next 33/36] drivers/soundwire/qcom.c:376 qcom_swrm_irq_handler() warn: impossible condition '(devnum < 0) => (0-255 < 0)'
Date: Wed, 31 Mar 2021 10:14:59 +0300 [thread overview]
Message-ID: <20210331071459.GE2088@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 3792 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git next
head: 06dd96738d618391ae58e1b28f1ba49fef214c95
commit: c7d49c76d1d5f5a41f637c18ce3b756351c7fdf9 [33/36] soundwire: qcom: add support to new interrupts
config: x86_64-randconfig-m001-20210330 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/soundwire/qcom.c:376 qcom_swrm_irq_handler() warn: impossible condition '(devnum < 0) => (0-255 < 0)'
vim +376 drivers/soundwire/qcom.c
02efb49aa805cee Srinivas Kandagatla 2020-01-13 356 static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 357 {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 358 struct qcom_swrm_ctrl *swrm = dev_id;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 359 u32 value, intr_sts, intr_sts_masked;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 360 u32 i;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 361 u8 devnum = 0;
^^^^^^^^^^^^^
no need to initalized devnum, btw.
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 362 int ret = IRQ_HANDLED;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 363
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 364 swrm->reg_read(swrm, SWRM_INTERRUPT_STATUS, &intr_sts);
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 365 intr_sts_masked = intr_sts & swrm->intr_mask;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 366
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 367 do {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 368 for (i = 0; i < SWRM_INTERRUPT_MAX; i++) {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 369 value = intr_sts_masked & BIT(i);
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 370 if (!value)
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 371 continue;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 372
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 373 switch (value) {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 374 case SWRM_INTERRUPT_STATUS_SLAVE_PEND_IRQ:
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 375 devnum = qcom_swrm_get_alert_slave_dev_num(swrm);
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 @376 if (devnum < 0) {
^^^^^^^^^^
"devnum" is a u8 so it can't be negative.
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 377 dev_err_ratelimited(swrm->dev,
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 378 "no slave alert found.spurious interrupt\n");
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 379 } else {
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 380 sdw_handle_slave_status(&swrm->bus, swrm->status);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 381 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 382
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 383 break;
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 384 case SWRM_INTERRUPT_STATUS_NEW_SLAVE_ATTACHED:
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 385 case SWRM_INTERRUPT_STATUS_CHANGE_ENUM_SLAVE_STATUS:
c7d49c76d1d5f5a Srinivas Kandagatla 2021-03-30 386 dev_err_ratelimited(swrm->dev, "%s: SWR new slave attached\n",
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45245 bytes --]
next reply other threads:[~2021-03-31 7:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 7:14 Dan Carpenter [this message]
2021-03-31 7:14 ` [kbuild] [vkoul-soundwire:next 33/36] drivers/soundwire/qcom.c:376 qcom_swrm_irq_handler() warn: impossible condition '(devnum < 0) => (0-255 < 0)' Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2021-03-31 6:25 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210331071459.GE2088@kadam \
--to=dan.carpenter@oracle.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.