:::::: :::::: Manual check reason: "low confidence static check first_new_problem: drivers/acpi/arm64/gtdt.c:355:19: sparse: sparse: cast to non-scalar" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev In-Reply-To: <20221109155618.42276-2-andriy.shevchenko@linux.intel.com> References: <20221109155618.42276-2-andriy.shevchenko@linux.intel.com> TO: Andy Shevchenko Hi Andy, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v6.1-rc5 next-20221114] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/resource-Replace-printk-KERN_WARNING-by-pr_warn-printk-by-pr_info/20221109-235627 patch link: https://lore.kernel.org/r/20221109155618.42276-2-andriy.shevchenko%40linux.intel.com patch subject: [PATCH v2 2/2] resource: Convert DEFINE_RES_NAMED() to be compound literal :::::: branch date: 5 days ago :::::: commit date: 5 days ago config: arm64-randconfig-s033-20221114 compiler: aarch64-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/0cfdea98d796194df5e0aa96ad24355b682e2beb git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/resource-Replace-printk-KERN_WARNING-by-pr_warn-printk-by-pr_info/20221109-235627 git checkout 0cfdea98d796194df5e0aa96ad24355b682e2beb # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/acpi/arm64/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/acpi/arm64/gtdt.c:355:19: sparse: sparse: cast to non-scalar >> drivers/acpi/arm64/gtdt.c:355:19: sparse: sparse: cast from non-scalar vim +355 drivers/acpi/arm64/gtdt.c ca9ae5ec4ef0ed Fu Wei 2017-04-01 324 ca9ae5ec4ef0ed Fu Wei 2017-04-01 325 /* ca9ae5ec4ef0ed Fu Wei 2017-04-01 326 * Initialize a SBSA generic Watchdog platform device info from GTDT ca9ae5ec4ef0ed Fu Wei 2017-04-01 327 */ ca9ae5ec4ef0ed Fu Wei 2017-04-01 328 static int __init gtdt_import_sbsa_gwdt(struct acpi_gtdt_watchdog *wd, ca9ae5ec4ef0ed Fu Wei 2017-04-01 329 int index) ca9ae5ec4ef0ed Fu Wei 2017-04-01 330 { ca9ae5ec4ef0ed Fu Wei 2017-04-01 331 struct platform_device *pdev; 1ecd5b12925224 Marc Zyngier 2021-04-21 332 int irq; ca9ae5ec4ef0ed Fu Wei 2017-04-01 333 ca9ae5ec4ef0ed Fu Wei 2017-04-01 334 /* ca9ae5ec4ef0ed Fu Wei 2017-04-01 335 * According to SBSA specification the size of refresh and control ca9ae5ec4ef0ed Fu Wei 2017-04-01 336 * frames of SBSA Generic Watchdog is SZ_4K(Offset 0x000 – 0xFFF). ca9ae5ec4ef0ed Fu Wei 2017-04-01 337 */ ca9ae5ec4ef0ed Fu Wei 2017-04-01 338 struct resource res[] = { ca9ae5ec4ef0ed Fu Wei 2017-04-01 339 DEFINE_RES_MEM(wd->control_frame_address, SZ_4K), ca9ae5ec4ef0ed Fu Wei 2017-04-01 340 DEFINE_RES_MEM(wd->refresh_frame_address, SZ_4K), 1ecd5b12925224 Marc Zyngier 2021-04-21 341 {}, ca9ae5ec4ef0ed Fu Wei 2017-04-01 342 }; ca9ae5ec4ef0ed Fu Wei 2017-04-01 343 int nr_res = ARRAY_SIZE(res); ca9ae5ec4ef0ed Fu Wei 2017-04-01 344 ca9ae5ec4ef0ed Fu Wei 2017-04-01 345 pr_debug("found a Watchdog (0x%llx/0x%llx gsi:%u flags:0x%x).\n", ca9ae5ec4ef0ed Fu Wei 2017-04-01 346 wd->refresh_frame_address, wd->control_frame_address, ca9ae5ec4ef0ed Fu Wei 2017-04-01 347 wd->timer_interrupt, wd->timer_flags); ca9ae5ec4ef0ed Fu Wei 2017-04-01 348 ca9ae5ec4ef0ed Fu Wei 2017-04-01 349 if (!(wd->refresh_frame_address && wd->control_frame_address)) { ca9ae5ec4ef0ed Fu Wei 2017-04-01 350 pr_err(FW_BUG "failed to get the Watchdog base address.\n"); ca9ae5ec4ef0ed Fu Wei 2017-04-01 351 return -EINVAL; ca9ae5ec4ef0ed Fu Wei 2017-04-01 352 } ca9ae5ec4ef0ed Fu Wei 2017-04-01 353 1ecd5b12925224 Marc Zyngier 2021-04-21 354 irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags); 1ecd5b12925224 Marc Zyngier 2021-04-21 @355 res[2] = (struct resource)DEFINE_RES_IRQ(irq); ca9ae5ec4ef0ed Fu Wei 2017-04-01 356 if (irq <= 0) { ca9ae5ec4ef0ed Fu Wei 2017-04-01 357 pr_warn("failed to map the Watchdog interrupt.\n"); ca9ae5ec4ef0ed Fu Wei 2017-04-01 358 nr_res--; ca9ae5ec4ef0ed Fu Wei 2017-04-01 359 } ca9ae5ec4ef0ed Fu Wei 2017-04-01 360 ca9ae5ec4ef0ed Fu Wei 2017-04-01 361 /* ca9ae5ec4ef0ed Fu Wei 2017-04-01 362 * Add a platform device named "sbsa-gwdt" to match the platform driver. ca9ae5ec4ef0ed Fu Wei 2017-04-01 363 * "sbsa-gwdt": SBSA(Server Base System Architecture) Generic Watchdog ca9ae5ec4ef0ed Fu Wei 2017-04-01 364 * The platform driver can get device info below by matching this name. ca9ae5ec4ef0ed Fu Wei 2017-04-01 365 */ ca9ae5ec4ef0ed Fu Wei 2017-04-01 366 pdev = platform_device_register_simple("sbsa-gwdt", index, res, nr_res); ca9ae5ec4ef0ed Fu Wei 2017-04-01 367 if (IS_ERR(pdev)) { 1ecd5b12925224 Marc Zyngier 2021-04-21 368 if (irq > 0) ca9ae5ec4ef0ed Fu Wei 2017-04-01 369 acpi_unregister_gsi(wd->timer_interrupt); ca9ae5ec4ef0ed Fu Wei 2017-04-01 370 return PTR_ERR(pdev); ca9ae5ec4ef0ed Fu Wei 2017-04-01 371 } ca9ae5ec4ef0ed Fu Wei 2017-04-01 372 ca9ae5ec4ef0ed Fu Wei 2017-04-01 373 return 0; ca9ae5ec4ef0ed Fu Wei 2017-04-01 374 } ca9ae5ec4ef0ed Fu Wei 2017-04-01 375 -- 0-DAY CI Kernel Test Service https://01.org/lkp