Skip to contentSkip to conversation

drivers/cxl/core/region.c:3263:26: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'}

PATCH kernel test robot 1 participant 1 message Feb 28, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c0eb65494e59d9834af7cbad983629e9017b25a1
commit: 0ec9849b63338da7883440ed3f52757cd8c847b1 [6260/7423] acpi/hmat / cxl: Add extended linear cache support for CXL
config: arm-randconfig-001-20250301 (https://download.01.org/0day-ci/archive/20250301/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250301/[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:5:
drivers/cxl/core/region.c: In function 'cxl_extended_linear_cache_resize':
drivers/cxl/core/region.c:3263:26: warning: '#' flag used with '%d' gnu_printf format [-Wformat=]

    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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:156:61: note: in expansion of macro 'dev_fmt'
     156 |         dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                             ^~~~~~~
   drivers/cxl/core/region.c:3262:17: note: in expansion of macro 'dev_warn'
    3262 |                 dev_warn(&cxlr->dev,
         |                 ^~~~~~~~
   drivers/cxl/core/region.c:3263:58: note: format string is defined here
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                                                          ^
>> drivers/cxl/core/region.c:3263:26: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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:156:61: note: in expansion of macro 'dev_fmt'
     156 |         dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                             ^~~~~~~
   drivers/cxl/core/region.c:3262:17: note: in expansion of macro 'dev_warn'
    3262 |                 dev_warn(&cxlr->dev,
         |                 ^~~~~~~~
   drivers/cxl/core/region.c:3263:58: note: format string is defined here
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                                                      ~~~~^
         |                                                          |
         |                                                          long long int
         |                                                      %#d
   drivers/cxl/core/region.c:3263:26: warning: '#' flag used with '%d' gnu_printf format [-Wformat=]
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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:156:61: note: in expansion of macro 'dev_fmt'
     156 |         dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                             ^~~~~~~
   drivers/cxl/core/region.c:3262:17: note: in expansion of macro 'dev_warn'
    3262 |                 dev_warn(&cxlr->dev,
         |                 ^~~~~~~~
   drivers/cxl/core/region.c:3263:76: note: format string is defined here
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                                                                            ^
   drivers/cxl/core/region.c:3263:26: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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:156:61: note: in expansion of macro 'dev_fmt'
     156 |         dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                             ^~~~~~~
   drivers/cxl/core/region.c:3262:17: note: in expansion of macro 'dev_warn'
    3262 |                 dev_warn(&cxlr->dev,
         |                 ^~~~~~~~
   drivers/cxl/core/region.c:3263:76: note: format string is defined here
    3263 |                          "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",
         |                                                                        ~~~~^
         |                                                                            |
         |                                                                            long long int
         |                                                                        %#d

vim +3263 drivers/cxl/core/region.c

3240
3241 static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
3242 struct resource *res)
3243 {
3244 struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent);
3245 struct cxl_region_params *p = &cxlr->params;
3246 int nid = phys_to_target_node(res->start);
3247 resource_size_t size, cache_size, start;
3248 int rc;
3249
3250 size = resource_size(res);
3251 if (!size)
3252 return -EINVAL;
3253
3254 rc = cxl_acpi_get_extended_linear_cache_size(res, nid, &cache_size);
3255 if (rc)
3256 return rc;
3257
3258 if (!cache_size)
3259 return 0;
3260
3261 if (size != cache_size) {

> 3262			dev_warn(&cxlr->dev,
> 3263				 "Extended Linear Cache size %#lld != CXL size %#lld. No Support!",

3264 cache_size, size);
3265 return -EOPNOTSUPP;
3266 }
3267
3268 /*
3269 * Move the start of the range to where the cache range starts. The
3270 * implementation assumes that the cache range is in front of the
3271 * CXL range. This is not dictated by the HMAT spec but is how the
3272 * current known implementation is configured.
3273 *
3274 * The cache range is expected to be within the CFMWS. The adjusted
3275 * res->start should not be less than cxlrd->res->start.
3276 */
3277 start = res->start - cache_size;
3278 if (start < cxlrd->res->start)
3279 return -ENXIO;
3280
3281 res->start = start;
3282 p->cache_size = cache_size;
3283
3284 return 0;
3285 }
3286

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