From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: drivers/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'
Date: Thu, 03 Sep 2020 15:21:59 +0300 [thread overview]
Message-ID: <20200903122159.GE8299@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 4864 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fc3abb53250a90ba2150eebd182137c136f4d25a
commit: a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49 irqchip/ti-sci-intr: Add support for INTR being a parent to INTR
config: arm64-randconfig-m031-20200902 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 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/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49
vim +148 drivers/irqchip/irq-ti-sci-intr.c
a5b659bd4bc751 Lokesh Vutla 2020-08-06 134 static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain,
cd844b0715ceda Lokesh Vutla 2019-04-30 135 unsigned int virq, u32 hwirq)
cd844b0715ceda Lokesh Vutla 2019-04-30 136 {
cd844b0715ceda Lokesh Vutla 2019-04-30 137 struct ti_sci_intr_irq_domain *intr = domain->host_data;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 138 struct device_node *parent_node;
cd844b0715ceda Lokesh Vutla 2019-04-30 139 struct irq_fwspec fwspec;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 140 u16 out_irq, p_hwirq;
^^^ ^^^^^^^
a5b659bd4bc751 Lokesh Vutla 2020-08-06 141 int err = 0;
cd844b0715ceda Lokesh Vutla 2019-04-30 142
a5b659bd4bc751 Lokesh Vutla 2020-08-06 143 out_irq = ti_sci_get_free_resource(intr->out_irqs);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 144 if (out_irq == TI_SCI_RESOURCE_NULL)
cd844b0715ceda Lokesh Vutla 2019-04-30 145 return -EINVAL;
cd844b0715ceda Lokesh Vutla 2019-04-30 146
a5b659bd4bc751 Lokesh Vutla 2020-08-06 147 p_hwirq = ti_sci_intr_xlate_irq(intr, out_irq);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 @148 if (p_hwirq < 0)
^^^^^^^^^^^
Impossible
a5b659bd4bc751 Lokesh Vutla 2020-08-06 149 goto err_irqs;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 150
a5b659bd4bc751 Lokesh Vutla 2020-08-06 151 parent_node = of_irq_find_parent(dev_of_node(intr->dev));
a5b659bd4bc751 Lokesh Vutla 2020-08-06 152 fwspec.fwnode = of_node_to_fwnode(parent_node);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 153
a5b659bd4bc751 Lokesh Vutla 2020-08-06 154 if (of_device_is_compatible(parent_node, "arm,gic-v3")) {
a5b659bd4bc751 Lokesh Vutla 2020-08-06 155 /* Parent is GIC */
cd844b0715ceda Lokesh Vutla 2019-04-30 156 fwspec.param_count = 3;
cd844b0715ceda Lokesh Vutla 2019-04-30 157 fwspec.param[0] = 0; /* SPI */
a5b659bd4bc751 Lokesh Vutla 2020-08-06 158 fwspec.param[1] = p_hwirq - 32; /* SPI offset */
cd844b0715ceda Lokesh Vutla 2019-04-30 159 fwspec.param[2] = intr->type;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 160 } else {
a5b659bd4bc751 Lokesh Vutla 2020-08-06 161 /* Parent is Interrupt Router */
a5b659bd4bc751 Lokesh Vutla 2020-08-06 162 fwspec.param_count = 1;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 163 fwspec.param[0] = p_hwirq;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 164 }
cd844b0715ceda Lokesh Vutla 2019-04-30 165
cd844b0715ceda Lokesh Vutla 2019-04-30 166 err = irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec);
cd844b0715ceda Lokesh Vutla 2019-04-30 167 if (err)
cd844b0715ceda Lokesh Vutla 2019-04-30 168 goto err_irqs;
cd844b0715ceda Lokesh Vutla 2019-04-30 169
a5b659bd4bc751 Lokesh Vutla 2020-08-06 170 err = intr->sci->ops.rm_irq_ops.set_irq(intr->sci,
a5b659bd4bc751 Lokesh Vutla 2020-08-06 171 intr->ti_sci_id, hwirq,
a5b659bd4bc751 Lokesh Vutla 2020-08-06 172 intr->ti_sci_id, out_irq);
cd844b0715ceda Lokesh Vutla 2019-04-30 173 if (err)
cd844b0715ceda Lokesh Vutla 2019-04-30 174 goto err_msg;
cd844b0715ceda Lokesh Vutla 2019-04-30 175
a5b659bd4bc751 Lokesh Vutla 2020-08-06 176 return p_hwirq;
cd844b0715ceda Lokesh Vutla 2019-04-30 177
cd844b0715ceda Lokesh Vutla 2019-04-30 178 err_msg:
cd844b0715ceda Lokesh Vutla 2019-04-30 179 irq_domain_free_irqs_parent(domain, virq, 1);
cd844b0715ceda Lokesh Vutla 2019-04-30 180 err_irqs:
a5b659bd4bc751 Lokesh Vutla 2020-08-06 181 ti_sci_release_resource(intr->out_irqs, out_irq);
cd844b0715ceda Lokesh Vutla 2019-04-30 182 return err;
cd844b0715ceda Lokesh Vutla 2019-04-30 183 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37827 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: drivers/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'
Date: Thu, 03 Sep 2020 15:21:59 +0300 [thread overview]
Message-ID: <20200903122159.GE8299@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 4864 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fc3abb53250a90ba2150eebd182137c136f4d25a
commit: a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49 irqchip/ti-sci-intr: Add support for INTR being a parent to INTR
config: arm64-randconfig-m031-20200902 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 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/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49
vim +148 drivers/irqchip/irq-ti-sci-intr.c
a5b659bd4bc751 Lokesh Vutla 2020-08-06 134 static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain,
cd844b0715ceda Lokesh Vutla 2019-04-30 135 unsigned int virq, u32 hwirq)
cd844b0715ceda Lokesh Vutla 2019-04-30 136 {
cd844b0715ceda Lokesh Vutla 2019-04-30 137 struct ti_sci_intr_irq_domain *intr = domain->host_data;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 138 struct device_node *parent_node;
cd844b0715ceda Lokesh Vutla 2019-04-30 139 struct irq_fwspec fwspec;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 140 u16 out_irq, p_hwirq;
^^^ ^^^^^^^
a5b659bd4bc751 Lokesh Vutla 2020-08-06 141 int err = 0;
cd844b0715ceda Lokesh Vutla 2019-04-30 142
a5b659bd4bc751 Lokesh Vutla 2020-08-06 143 out_irq = ti_sci_get_free_resource(intr->out_irqs);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 144 if (out_irq == TI_SCI_RESOURCE_NULL)
cd844b0715ceda Lokesh Vutla 2019-04-30 145 return -EINVAL;
cd844b0715ceda Lokesh Vutla 2019-04-30 146
a5b659bd4bc751 Lokesh Vutla 2020-08-06 147 p_hwirq = ti_sci_intr_xlate_irq(intr, out_irq);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 @148 if (p_hwirq < 0)
^^^^^^^^^^^
Impossible
a5b659bd4bc751 Lokesh Vutla 2020-08-06 149 goto err_irqs;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 150
a5b659bd4bc751 Lokesh Vutla 2020-08-06 151 parent_node = of_irq_find_parent(dev_of_node(intr->dev));
a5b659bd4bc751 Lokesh Vutla 2020-08-06 152 fwspec.fwnode = of_node_to_fwnode(parent_node);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 153
a5b659bd4bc751 Lokesh Vutla 2020-08-06 154 if (of_device_is_compatible(parent_node, "arm,gic-v3")) {
a5b659bd4bc751 Lokesh Vutla 2020-08-06 155 /* Parent is GIC */
cd844b0715ceda Lokesh Vutla 2019-04-30 156 fwspec.param_count = 3;
cd844b0715ceda Lokesh Vutla 2019-04-30 157 fwspec.param[0] = 0; /* SPI */
a5b659bd4bc751 Lokesh Vutla 2020-08-06 158 fwspec.param[1] = p_hwirq - 32; /* SPI offset */
cd844b0715ceda Lokesh Vutla 2019-04-30 159 fwspec.param[2] = intr->type;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 160 } else {
a5b659bd4bc751 Lokesh Vutla 2020-08-06 161 /* Parent is Interrupt Router */
a5b659bd4bc751 Lokesh Vutla 2020-08-06 162 fwspec.param_count = 1;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 163 fwspec.param[0] = p_hwirq;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 164 }
cd844b0715ceda Lokesh Vutla 2019-04-30 165
cd844b0715ceda Lokesh Vutla 2019-04-30 166 err = irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec);
cd844b0715ceda Lokesh Vutla 2019-04-30 167 if (err)
cd844b0715ceda Lokesh Vutla 2019-04-30 168 goto err_irqs;
cd844b0715ceda Lokesh Vutla 2019-04-30 169
a5b659bd4bc751 Lokesh Vutla 2020-08-06 170 err = intr->sci->ops.rm_irq_ops.set_irq(intr->sci,
a5b659bd4bc751 Lokesh Vutla 2020-08-06 171 intr->ti_sci_id, hwirq,
a5b659bd4bc751 Lokesh Vutla 2020-08-06 172 intr->ti_sci_id, out_irq);
cd844b0715ceda Lokesh Vutla 2019-04-30 173 if (err)
cd844b0715ceda Lokesh Vutla 2019-04-30 174 goto err_msg;
cd844b0715ceda Lokesh Vutla 2019-04-30 175
a5b659bd4bc751 Lokesh Vutla 2020-08-06 176 return p_hwirq;
cd844b0715ceda Lokesh Vutla 2019-04-30 177
cd844b0715ceda Lokesh Vutla 2019-04-30 178 err_msg:
cd844b0715ceda Lokesh Vutla 2019-04-30 179 irq_domain_free_irqs_parent(domain, virq, 1);
cd844b0715ceda Lokesh Vutla 2019-04-30 180 err_irqs:
a5b659bd4bc751 Lokesh Vutla 2020-08-06 181 ti_sci_release_resource(intr->out_irqs, out_irq);
cd844b0715ceda Lokesh Vutla 2019-04-30 182 return err;
cd844b0715ceda Lokesh Vutla 2019-04-30 183 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37827 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Lokesh Vutla <lokeshvutla@ti.com>
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>,
kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Marc Zyngier <maz@kernel.org>
Subject: drivers/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'
Date: Thu, 3 Sep 2020 15:21:59 +0300 [thread overview]
Message-ID: <20200903122159.GE8299@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 4784 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fc3abb53250a90ba2150eebd182137c136f4d25a
commit: a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49 irqchip/ti-sci-intr: Add support for INTR being a parent to INTR
config: arm64-randconfig-m031-20200902 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 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/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a5b659bd4bc7518a8e45fda5256c5e5e8d3b7c49
vim +148 drivers/irqchip/irq-ti-sci-intr.c
a5b659bd4bc751 Lokesh Vutla 2020-08-06 134 static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain,
cd844b0715ceda Lokesh Vutla 2019-04-30 135 unsigned int virq, u32 hwirq)
cd844b0715ceda Lokesh Vutla 2019-04-30 136 {
cd844b0715ceda Lokesh Vutla 2019-04-30 137 struct ti_sci_intr_irq_domain *intr = domain->host_data;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 138 struct device_node *parent_node;
cd844b0715ceda Lokesh Vutla 2019-04-30 139 struct irq_fwspec fwspec;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 140 u16 out_irq, p_hwirq;
^^^ ^^^^^^^
a5b659bd4bc751 Lokesh Vutla 2020-08-06 141 int err = 0;
cd844b0715ceda Lokesh Vutla 2019-04-30 142
a5b659bd4bc751 Lokesh Vutla 2020-08-06 143 out_irq = ti_sci_get_free_resource(intr->out_irqs);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 144 if (out_irq == TI_SCI_RESOURCE_NULL)
cd844b0715ceda Lokesh Vutla 2019-04-30 145 return -EINVAL;
cd844b0715ceda Lokesh Vutla 2019-04-30 146
a5b659bd4bc751 Lokesh Vutla 2020-08-06 147 p_hwirq = ti_sci_intr_xlate_irq(intr, out_irq);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 @148 if (p_hwirq < 0)
^^^^^^^^^^^
Impossible
a5b659bd4bc751 Lokesh Vutla 2020-08-06 149 goto err_irqs;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 150
a5b659bd4bc751 Lokesh Vutla 2020-08-06 151 parent_node = of_irq_find_parent(dev_of_node(intr->dev));
a5b659bd4bc751 Lokesh Vutla 2020-08-06 152 fwspec.fwnode = of_node_to_fwnode(parent_node);
a5b659bd4bc751 Lokesh Vutla 2020-08-06 153
a5b659bd4bc751 Lokesh Vutla 2020-08-06 154 if (of_device_is_compatible(parent_node, "arm,gic-v3")) {
a5b659bd4bc751 Lokesh Vutla 2020-08-06 155 /* Parent is GIC */
cd844b0715ceda Lokesh Vutla 2019-04-30 156 fwspec.param_count = 3;
cd844b0715ceda Lokesh Vutla 2019-04-30 157 fwspec.param[0] = 0; /* SPI */
a5b659bd4bc751 Lokesh Vutla 2020-08-06 158 fwspec.param[1] = p_hwirq - 32; /* SPI offset */
cd844b0715ceda Lokesh Vutla 2019-04-30 159 fwspec.param[2] = intr->type;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 160 } else {
a5b659bd4bc751 Lokesh Vutla 2020-08-06 161 /* Parent is Interrupt Router */
a5b659bd4bc751 Lokesh Vutla 2020-08-06 162 fwspec.param_count = 1;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 163 fwspec.param[0] = p_hwirq;
a5b659bd4bc751 Lokesh Vutla 2020-08-06 164 }
cd844b0715ceda Lokesh Vutla 2019-04-30 165
cd844b0715ceda Lokesh Vutla 2019-04-30 166 err = irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec);
cd844b0715ceda Lokesh Vutla 2019-04-30 167 if (err)
cd844b0715ceda Lokesh Vutla 2019-04-30 168 goto err_irqs;
cd844b0715ceda Lokesh Vutla 2019-04-30 169
a5b659bd4bc751 Lokesh Vutla 2020-08-06 170 err = intr->sci->ops.rm_irq_ops.set_irq(intr->sci,
a5b659bd4bc751 Lokesh Vutla 2020-08-06 171 intr->ti_sci_id, hwirq,
a5b659bd4bc751 Lokesh Vutla 2020-08-06 172 intr->ti_sci_id, out_irq);
cd844b0715ceda Lokesh Vutla 2019-04-30 173 if (err)
cd844b0715ceda Lokesh Vutla 2019-04-30 174 goto err_msg;
cd844b0715ceda Lokesh Vutla 2019-04-30 175
a5b659bd4bc751 Lokesh Vutla 2020-08-06 176 return p_hwirq;
cd844b0715ceda Lokesh Vutla 2019-04-30 177
cd844b0715ceda Lokesh Vutla 2019-04-30 178 err_msg:
cd844b0715ceda Lokesh Vutla 2019-04-30 179 irq_domain_free_irqs_parent(domain, virq, 1);
cd844b0715ceda Lokesh Vutla 2019-04-30 180 err_irqs:
a5b659bd4bc751 Lokesh Vutla 2020-08-06 181 ti_sci_release_resource(intr->out_irqs, out_irq);
cd844b0715ceda Lokesh Vutla 2019-04-30 182 return err;
cd844b0715ceda Lokesh Vutla 2019-04-30 183 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37827 bytes --]
next reply other threads:[~2020-09-03 12:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 12:21 Dan Carpenter [this message]
2020-09-03 12:21 ` drivers/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)' Dan Carpenter
2020-09-03 12:21 ` Dan Carpenter
2020-09-03 12:26 ` Lokesh Vutla
2020-09-03 12:26 ` Lokesh Vutla
-- strict thread matches above, loose matches on Subject: below --
2020-09-03 4:38 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=20200903122159.GE8299@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.