drivers/cxl/core/region.c:3664:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'}
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 1357b2649c026b51353c84ddd32bc963e8999603 commit: c3dd67681c70cc95cc2c889b1b58a1667bb1c48b [1811/2770] cxl/region: Add inject and clear poison by region offset config: i386-buildonly-randconfig-2001-20250813 (https://download.01.org/0day-ci/archive/20250816/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250816/[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 >>):
In file included from include/linux/device.h:15,
from drivers/cxl/core/region.c:6:
drivers/cxl/core/region.c: In function 'validate_region_offset':
>> drivers/cxl/core/region.c:3664:25: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
3664 | "Offset %#llx is within extended linear cache %#llx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:154:56: note: in expansion of macro 'dev_fmt'
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/cxl/core/region.c:3663:17: note: in expansion of macro 'dev_err'
3663 | dev_err(&cxlr->dev,
| ^~~~~~~
drivers/cxl/core/region.c:3664:75: note: format string is defined here
3664 | "Offset %#llx is within extended linear cache %#llx\n",
| ~~~~^
| |
| long long unsigned int
| %#x
drivers/cxl/core/region.c:3671:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
3671 | dev_err(&cxlr->dev, "Offset %#llx exceeds region size %#llx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:154:56: note: in expansion of macro 'dev_fmt'
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/cxl/core/region.c:3671:17: note: in expansion of macro 'dev_err'
3671 | dev_err(&cxlr->dev, "Offset %#llx exceeds region size %#llx\n",
| ^~~~~~~
drivers/cxl/core/region.c:3671:75: note: format string is defined here
3671 | dev_err(&cxlr->dev, "Offset %#llx exceeds region size %#llx\n",
| ~~~~^
| |
| long long unsigned int
| %#xvim +3664 drivers/cxl/core/region.c
3655
3656 static int validate_region_offset(struct cxl_region *cxlr, u64 offset)
3657 {
3658 struct cxl_region_params *p = &cxlr->params;
3659 resource_size_t region_size;
3660 u64 hpa;
3661
3662 if (offset < p->cache_size) {
3663 dev_err(&cxlr->dev,
> 3664 "Offset %#llx is within extended linear cache %#llx\n",
3665 offset, p->cache_size);
3666 return -EINVAL;
3667 }
3668
3669 region_size = resource_size(p->res);
3670 if (offset >= region_size) {
3671 dev_err(&cxlr->dev, "Offset %#llx exceeds region size %#llx\n",
3672 offset, region_size);
3673 return -EINVAL;
3674 }
3675
3676 hpa = p->res->start + offset;
3677 if (hpa < p->res->start || hpa > p->res->end) {
3678 dev_err(&cxlr->dev, "HPA %#llx not in region %pr\n", hpa,
3679 p->res);
3680 return -EINVAL;
3681 }
3682
3683 return 0;
3684 }
3685
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki