drivers/edac/aspeed_edac.c:257:21: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'}

From: kernel test robot
Date: Sat May 01 2021 - 14:43:38 EST


Hi Troy,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9f67672a817ec046f7554a885f0fe0d60e1bf99f
commit: edfc2d73ca45da19fb76f9b76ecc6e885d74d093 EDAC/aspeed: Add support for AST2400 and AST2600
date: 5 months ago
config: arm-randconfig-r035-20210502 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=edfc2d73ca45da19fb76f9b76ecc6e885d74d093
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout edfc2d73ca45da19fb76f9b76ecc6e885d74d093
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arm

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In file included from include/linux/device.h:15,
from include/linux/edac.h:16,
from drivers/edac/aspeed_edac.c:6:
drivers/edac/aspeed_edac.c: In function 'init_csrows':
>> drivers/edac/aspeed_edac.c:257:21: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/edac/aspeed_edac.c:257:2: note: in expansion of macro 'dev_dbg'
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
| ^~~~~~~
drivers/edac/aspeed_edac.c:257:72: note: format string is defined here
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
| ~^
| |
| unsigned int
| %llx
In file included from include/linux/device.h:15,
from include/linux/edac.h:16,
from drivers/edac/aspeed_edac.c:6:
drivers/edac/aspeed_edac.c:257:21: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/edac/aspeed_edac.c:257:2: note: in expansion of macro 'dev_dbg'
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
| ^~~~~~~
drivers/edac/aspeed_edac.c:257:92: note: format string is defined here
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
| ~^
| |
| unsigned int
| %llx


vim +257 drivers/edac/aspeed_edac.c

9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 229
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 230
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 231 static int init_csrows(struct mem_ctl_info *mci)
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 232 {
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 233 struct csrow_info *csrow = mci->csrows[0];
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 234 u32 nr_pages, dram_type;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 235 struct dimm_info *dimm;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 236 struct device_node *np;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 237 struct resource r;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 238 u32 reg04;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 239 int rc;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 240
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 241 /* retrieve info about physical memory from device tree */
edfc2d73ca45da Troy Lee 2020-12-07 242 np = of_find_node_by_name(NULL, "memory");
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 243 if (!np) {
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 244 dev_err(mci->pdev, "dt: missing /memory node\n");
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 245 return -ENODEV;
a651c6c6443176 Xu Wang 2019-12-18 246 }
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 247
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 248 rc = of_address_to_resource(np, 0, &r);
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 249
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 250 of_node_put(np);
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 251
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 252 if (rc) {
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 253 dev_err(mci->pdev, "dt: failed requesting resource for /memory node\n");
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 254 return rc;
a651c6c6443176 Xu Wang 2019-12-18 255 }
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 256
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 @257 dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 258 r.start, resource_size(&r), PAGE_SHIFT);
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 259
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 260 csrow->first_page = r.start >> PAGE_SHIFT;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 261 nr_pages = resource_size(&r) >> PAGE_SHIFT;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 262 csrow->last_page = csrow->first_page + nr_pages - 1;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 263
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 264 regmap_read(aspeed_regmap, ASPEED_MCR_CONF, &reg04);
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 265 dram_type = (reg04 & ASPEED_MCR_CONF_DRAM_TYPE) ? MEM_DDR4 : MEM_DDR3;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 266
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 267 dimm = csrow->channels[0]->dimm;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 268 dimm->mtype = dram_type;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 269 dimm->edac_mode = EDAC_SECDED;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 270 dimm->nr_pages = nr_pages / csrow->nr_channels;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 271
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 272 dev_dbg(mci->pdev, "initialized dimm with first_page=0x%lx and nr_pages=0x%x\n",
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 273 csrow->first_page, nr_pages);
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 274
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 275 return 0;
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 276 }
9b7e6242ee4efc Stefan M Schaeckeler 2019-01-17 277

:::::: The code at line 257 was first introduced by commit
:::::: 9b7e6242ee4efcd7f9ef699bf1965e3a5343f216 EDAC, aspeed: Add an Aspeed AST2500 EDAC driver

:::::: TO: Stefan M Schaeckeler <sschaeck@xxxxxxxxx>
:::::: CC: Borislav Petkov <bp@xxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip