Skip to contentSkip to conversation

drivers/firmware/arm_scmi/telemetry.c:356:9: warning: format specifies type 'unsigned long long' but the argument has type 'phys_addr_t' (aka 'unsigned int')

PATCH kernel test robot 1 participant 1 message Nov 9

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/cris/linux.git scmi_telemetry_ng_V15
head:   d51f22cab86f4ad2f08b4e88803f85fdffd81a62
commit: 64c4292f50171fb197737a97cf5cd8b6d378984f [10/35] firmware: arm_scmi: Add Telemetry resources enumeration
config: hexagon-randconfig-1001-20261109 (https://download.01.org/0day-ci/archive/20261109/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261109/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/firmware/arm_scmi/telemetry.c:356:9: warning: format specifies type 'unsigned long long' but the argument has type 'phys_addr_t' (aka 'unsigned int') [-Wformat]
     355 |                 dev_err(dev, FW_BUG "%s phys_addr (0x%llX) pointer too big.\n",
         |                                                      ~~~~
         |                                                      %X
     356 |                         tag, pa);
         |                              ^~
   include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err'
     154 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                                ~~~     ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ~~~    ^~~~~~~~~~~
   drivers/firmware/arm_scmi/telemetry.c:362:9: warning: format specifies type 'unsigned long long' but the argument has type 'phys_addr_t' (aka 'unsigned int') [-Wformat]
     361 |                 dev_err(dev, FW_BUG "%s phys_addr (0x%llX) misaligned.\n",
         |                                                      ~~~~
         |                                                      %X
     362 |                         tag, pa);
         |                              ^~
   include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err'
     154 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                                ~~~     ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ~~~    ^~~~~~~~~~~
   drivers/firmware/arm_scmi/telemetry.c:374:9: warning: format specifies type 'unsigned long long' but the argument has type 'phys_addr_t' (aka 'unsigned int') [-Wformat]
     373 |                 dev_err(dev, FW_BUG "%s area (0x%llX/%u) wrap-around.\n",
         |                                                 ~~~~
         |                                                 %X
     374 |                         tag, pa, size);
         |                              ^~
   include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err'
     154 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                                ~~~     ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ~~~    ^~~~~~~~~~~

3 warnings generated.

vim +356 drivers/firmware/arm_scmi/telemetry.c

343
344 static inline int
345 scmi_telemetry_area_check(struct device *dev, const char *tag,
346 u32 low, u32 high, u32 size,
347 phys_addr_t *phys_addr, size_t *len)
348 {
349 u64 addr = ((u64)high << 32) | low;
350 phys_addr_t pa = (phys_addr_t)addr;
351 unsigned long end_phys;
352
353 /* Does the returned pointer fits architetural size ? */
354 if ((u64)pa != addr) {
355 dev_err(dev, FW_BUG "%s phys_addr (0x%llX) pointer too big.\n",

 > 356				tag, pa);

357 return -EOVERFLOW;
358 }
359
360 if (!IS_ALIGNED(pa, 4)) {
361 dev_err(dev, FW_BUG "%s phys_addr (0x%llX) misaligned.\n",
362 tag, pa);
363 return -EINVAL;
364 }
365
366 if (!IS_ALIGNED(size, 4)) {
367 dev_err(dev, FW_BUG "%s area length (%u) misaligned\n",
368 tag, size);
369 return -EINVAL;
370 }
371
372 if (check_add_overflow(pa, size, &end_phys)) {
373 dev_err(dev, FW_BUG "%s area (0x%llX/%u) wrap-around.\n",
374 tag, pa, size);
375 return -EOVERFLOW;
376 }
377
378 *phys_addr = pa;
379 *len = size;
380
381 return 0;
382 }
383

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki