From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Peng Fan <peng.fan@nxp.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, Shawn Guo <shawnguo@kernel.org>
Subject: [kbuild] drivers/irqchip/irq-gic-v3-mbi.c:306 mbi_init() warn: impossible condition '(mbi_phys_base == (-1)) => (0-u32max == u64max)'
Date: Tue, 8 Sep 2020 20:49:18 +0300 [thread overview]
Message-ID: <20200908174918.GR8321@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 4431 bytes --]
Hi Peng,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f4d51dffc6c01a9e94650d95ce0104964f8ae822
commit: d82bcef5157de1368c08244a846ab968b3e5cb7e soc: imx: select ARM_GIC_V3 for i.MX8M
config: arm-randconfig-m031-20200908 (attached as .config)
compiler: arm-linux-gnueabi-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-gic-v3-mbi.c:306 mbi_init() warn: impossible condition '(mbi_phys_base == (-1)) => (0-u32max == u64max)'
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d82bcef5157de1368c08244a846ab968b3e5cb7e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d82bcef5157de1368c08244a846ab968b3e5cb7e
vim +306 drivers/irqchip/irq-gic-v3-mbi.c
505287525c24d5 Marc Zyngier 2018-05-08 263 int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent)
505287525c24d5 Marc Zyngier 2018-05-08 264 {
505287525c24d5 Marc Zyngier 2018-05-08 265 struct device_node *np;
505287525c24d5 Marc Zyngier 2018-05-08 266 const __be32 *reg;
505287525c24d5 Marc Zyngier 2018-05-08 267 int ret, n;
505287525c24d5 Marc Zyngier 2018-05-08 268
505287525c24d5 Marc Zyngier 2018-05-08 269 np = to_of_node(fwnode);
505287525c24d5 Marc Zyngier 2018-05-08 270
505287525c24d5 Marc Zyngier 2018-05-08 271 if (!of_property_read_bool(np, "msi-controller"))
505287525c24d5 Marc Zyngier 2018-05-08 272 return 0;
505287525c24d5 Marc Zyngier 2018-05-08 273
505287525c24d5 Marc Zyngier 2018-05-08 274 n = of_property_count_elems_of_size(np, "mbi-ranges", sizeof(u32));
505287525c24d5 Marc Zyngier 2018-05-08 275 if (n <= 0 || n % 2)
505287525c24d5 Marc Zyngier 2018-05-08 276 return -EINVAL;
505287525c24d5 Marc Zyngier 2018-05-08 277
505287525c24d5 Marc Zyngier 2018-05-08 278 mbi_range_nr = n / 2;
505287525c24d5 Marc Zyngier 2018-05-08 279 mbi_ranges = kcalloc(mbi_range_nr, sizeof(*mbi_ranges), GFP_KERNEL);
505287525c24d5 Marc Zyngier 2018-05-08 280 if (!mbi_ranges)
505287525c24d5 Marc Zyngier 2018-05-08 281 return -ENOMEM;
505287525c24d5 Marc Zyngier 2018-05-08 282
505287525c24d5 Marc Zyngier 2018-05-08 283 for (n = 0; n < mbi_range_nr; n++) {
505287525c24d5 Marc Zyngier 2018-05-08 284 ret = of_property_read_u32_index(np, "mbi-ranges", n * 2,
505287525c24d5 Marc Zyngier 2018-05-08 285 &mbi_ranges[n].spi_start);
505287525c24d5 Marc Zyngier 2018-05-08 286 if (ret)
505287525c24d5 Marc Zyngier 2018-05-08 287 goto err_free_mbi;
505287525c24d5 Marc Zyngier 2018-05-08 288 ret = of_property_read_u32_index(np, "mbi-ranges", n * 2 + 1,
505287525c24d5 Marc Zyngier 2018-05-08 289 &mbi_ranges[n].nr_spis);
505287525c24d5 Marc Zyngier 2018-05-08 290 if (ret)
505287525c24d5 Marc Zyngier 2018-05-08 291 goto err_free_mbi;
505287525c24d5 Marc Zyngier 2018-05-08 292
505287525c24d5 Marc Zyngier 2018-05-08 293 mbi_ranges[n].bm = kcalloc(BITS_TO_LONGS(mbi_ranges[n].nr_spis),
505287525c24d5 Marc Zyngier 2018-05-08 294 sizeof(long), GFP_KERNEL);
505287525c24d5 Marc Zyngier 2018-05-08 295 if (!mbi_ranges[n].bm) {
505287525c24d5 Marc Zyngier 2018-05-08 296 ret = -ENOMEM;
505287525c24d5 Marc Zyngier 2018-05-08 297 goto err_free_mbi;
505287525c24d5 Marc Zyngier 2018-05-08 298 }
505287525c24d5 Marc Zyngier 2018-05-08 299 pr_info("MBI range [%d:%d]\n", mbi_ranges[n].spi_start,
505287525c24d5 Marc Zyngier 2018-05-08 300 mbi_ranges[n].spi_start + mbi_ranges[n].nr_spis - 1);
505287525c24d5 Marc Zyngier 2018-05-08 301 }
505287525c24d5 Marc Zyngier 2018-05-08 302
505287525c24d5 Marc Zyngier 2018-05-08 303 reg = of_get_property(np, "mbi-alias", NULL);
505287525c24d5 Marc Zyngier 2018-05-08 304 if (reg) {
505287525c24d5 Marc Zyngier 2018-05-08 305 mbi_phys_base = of_translate_address(np, reg);
505287525c24d5 Marc Zyngier 2018-05-08 @306 if (mbi_phys_base == OF_BAD_ADDR) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Impossible condition.
---
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: 42555 bytes --]
[-- Attachment #3: Type: text/plain, Size: 149 bytes --]
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
reply other threads:[~2020-09-08 17:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200908174918.GR8321@kadam \
--to=dan.carpenter@oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=peng.fan@nxp.com \
--cc=shawnguo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®