From: kernel test robot <lkp@intel.com>
To: Yue Haibing <yuehaibing@huawei.com>,
anup@brainfault.org, tglx@linutronix.de,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, ruanjinjie@huawei.com, bjorn@rivosinc.com
Cc: oe-kbuild-all@lists.linux.dev, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, yuehaibing@huawei.com
Subject: Re: [PATCH -next] irqchip/riscv-aplic: Fix NULL vs IS_ERR() bug
Date: Fri, 23 Aug 2024 05:36:20 +0800 [thread overview]
Message-ID: <202408230558.er4j09Nd-lkp@intel.com> (raw)
In-Reply-To: <20240820132857.247679-1-yuehaibing@huawei.com>
Hi Yue,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20240820]
url: https://github.com/intel-lab-lkp/linux/commits/Yue-Haibing/irqchip-riscv-aplic-Fix-NULL-vs-IS_ERR-bug/20240820-213521
base: next-20240820
patch link: https://lore.kernel.org/r/20240820132857.247679-1-yuehaibing%40huawei.com
patch subject: [PATCH -next] irqchip/riscv-aplic: Fix NULL vs IS_ERR() bug
config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20240823/202408230558.er4j09Nd-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240823/202408230558.er4j09Nd-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408230558.er4j09Nd-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
drivers/irqchip/irq-riscv-aplic-main.c: In function 'aplic_probe':
>> drivers/irqchip/irq-riscv-aplic-main.c:178:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
178 | if (IS_ERR(regs))
| ^~
drivers/irqchip/irq-riscv-aplic-main.c:180:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
180 | return PTR_ERR(regs);
| ^~~~~~
>> drivers/irqchip/irq-riscv-aplic-main.c:174:13: warning: unused variable 'rc' [-Wunused-variable]
174 | int rc;
| ^~
>> drivers/irqchip/irq-riscv-aplic-main.c:172:14: warning: unused variable 'msi_mode' [-Wunused-variable]
172 | bool msi_mode = false;
| ^~~~~~~~
drivers/irqchip/irq-riscv-aplic-main.c: At top level:
>> drivers/irqchip/irq-riscv-aplic-main.c:187:9: warning: data definition has no type or storage class
187 | msi_mode = of_property_present(to_of_node(dev->fwnode), "msi-parent");
| ^~~~~~~~
>> drivers/irqchip/irq-riscv-aplic-main.c:187:9: error: type defaults to 'int' in declaration of 'msi_mode' [-Wimplicit-int]
In file included from drivers/irqchip/irq-riscv-aplic-main.c:10:
>> include/linux/of.h:168:9: error: braced-group within expression allowed only inside a function
168 | ({ \
| ^
drivers/irqchip/irq-riscv-aplic-main.c:187:40: note: in expansion of macro 'to_of_node'
187 | msi_mode = of_property_present(to_of_node(dev->fwnode), "msi-parent");
| ^~~~~~~~~~
>> drivers/irqchip/irq-riscv-aplic-main.c:188:9: error: expected identifier or '(' before 'if'
188 | if (msi_mode)
| ^~
>> drivers/irqchip/irq-riscv-aplic-main.c:190:9: error: expected identifier or '(' before 'else'
190 | else
| ^~~~
drivers/irqchip/irq-riscv-aplic-main.c:192:9: error: expected identifier or '(' before 'if'
192 | if (rc)
| ^~
In file included from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/irqchip/irq-riscv-aplic-main.c:12:
>> include/linux/dev_printk.h:111:10: error: expected identifier or '(' before ')' token
111 | })
| ^
include/linux/dev_printk.h:154:9: note: in expansion of macro 'dev_printk_index_wrap'
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/irqchip/irq-riscv-aplic-main.c:193:17: note: in expansion of macro 'dev_err'
193 | dev_err(dev, "failed to setup APLIC in %s mode\n", msi_mode ? "MSI" : "direct");
| ^~~~~~~
>> drivers/irqchip/irq-riscv-aplic-main.c:195:9: error: expected identifier or '(' before 'return'
195 | return rc;
| ^~~~~~
>> drivers/irqchip/irq-riscv-aplic-main.c:196:1: error: expected identifier or '(' before '}' token
196 | }
| ^
vim +187 drivers/irqchip/irq-riscv-aplic-main.c
2333df5ae51ead Anup Patel 2024-03-07 168
2333df5ae51ead Anup Patel 2024-03-07 169 static int aplic_probe(struct platform_device *pdev)
2333df5ae51ead Anup Patel 2024-03-07 170 {
2333df5ae51ead Anup Patel 2024-03-07 171 struct device *dev = &pdev->dev;
2333df5ae51ead Anup Patel 2024-03-07 @172 bool msi_mode = false;
2333df5ae51ead Anup Patel 2024-03-07 173 void __iomem *regs;
2333df5ae51ead Anup Patel 2024-03-07 @174 int rc;
2333df5ae51ead Anup Patel 2024-03-07 175
2333df5ae51ead Anup Patel 2024-03-07 176 /* Map the MMIO registers */
2333df5ae51ead Anup Patel 2024-03-07 177 regs = devm_platform_ioremap_resource(pdev, 0);
bb109b384dab1e Yue Haibing 2024-08-20 @178 if (IS_ERR(regs))
2333df5ae51ead Anup Patel 2024-03-07 179 dev_err(dev, "failed map MMIO registers\n");
bb109b384dab1e Yue Haibing 2024-08-20 180 return PTR_ERR(regs);
2333df5ae51ead Anup Patel 2024-03-07 181 }
2333df5ae51ead Anup Patel 2024-03-07 182
2333df5ae51ead Anup Patel 2024-03-07 183 /*
2333df5ae51ead Anup Patel 2024-03-07 184 * If msi-parent property is present then setup APLIC MSI
2333df5ae51ead Anup Patel 2024-03-07 185 * mode otherwise setup APLIC direct mode.
2333df5ae51ead Anup Patel 2024-03-07 186 */
2333df5ae51ead Anup Patel 2024-03-07 @187 msi_mode = of_property_present(to_of_node(dev->fwnode), "msi-parent");
2333df5ae51ead Anup Patel 2024-03-07 @188 if (msi_mode)
ca8df97fe6798a Anup Patel 2024-03-07 189 rc = aplic_msi_setup(dev, regs);
2333df5ae51ead Anup Patel 2024-03-07 @190 else
2333df5ae51ead Anup Patel 2024-03-07 191 rc = aplic_direct_setup(dev, regs);
2333df5ae51ead Anup Patel 2024-03-07 192 if (rc)
2333df5ae51ead Anup Patel 2024-03-07 193 dev_err(dev, "failed to setup APLIC in %s mode\n", msi_mode ? "MSI" : "direct");
2333df5ae51ead Anup Patel 2024-03-07 194
2333df5ae51ead Anup Patel 2024-03-07 @195 return rc;
2333df5ae51ead Anup Patel 2024-03-07 @196 }
2333df5ae51ead Anup Patel 2024-03-07 197
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2024-08-22 21:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 13:28 [PATCH -next] irqchip/riscv-aplic: Fix NULL vs IS_ERR() bug Yue Haibing
2024-08-20 14:15 ` Anup Patel
2024-08-22 21:36 ` kernel test robot [this message]
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=202408230558.er4j09Nd-lkp@intel.com \
--to=lkp@intel.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=bjorn@rivosinc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=ruanjinjie@huawei.com \
--cc=tglx@linutronix.de \
--cc=yuehaibing@huawei.com \
/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