Skip to contentSkip to conversation

drivers/perf/arm-cmn.c:1329:4: warning: format specifies type 'unsigned short' but the argument has underlying type 'unsigned int'

PATCH kernel test robot 1 participant 1 message Sep 30, 2020

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:   de69ee6df1cfbf3c67787d8504fd21b59da39572
commit: 0ba64770a2f2e5a104bf835e133d78d3f82287ad [11137/12330] perf: Add Arm CMN-600 PMU driver
config: x86_64-randconfig-r031-20200930 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project bcd05599d0e53977a963799d6ee4f6e0bc21331b)

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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0ba64770a2f2e5a104bf835e133d78d3f82287ad
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 0ba64770a2f2e5a104bf835e133d78d3f82287ad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/perf/arm-cmn.c:1329:4: warning: format specifies type 'unsigned short' but the argument has underlying type 'unsigned int' [-Wformat]
                           node->type, node->logid, offset);
                           ^~~~~~~~~~
   include/linux/dev_printk.h:115:39: note: expanded from macro 'dev_dbg'
           dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                        ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:158:19: note: expanded from macro 'dynamic_dev_dbg'
                              dev, fmt, ##__VA_ARGS__)
                                   ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:143:56: note: expanded from macro '_dynamic_func_call'
           __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
                                                                 ^~~~~~~~~~~
   include/linux/dynamic_debug.h:125:15: note: expanded from macro '__dynamic_func_call'
                   func(&id, ##__VA_ARGS__);               \
                               ^~~~~~~~~~~
   drivers/perf/arm-cmn.c:1433:60: warning: format specifies type 'unsigned short' but the argument has underlying type 'unsigned int' [-Wformat]
                                   dev_err(cmn->dev, "invalid device node type: 0x%hx\n", dn->type);
                                                                                  ~~~     ^~~~~~~~
                                                                                  %x
   include/linux/dev_printk.h:104:32: note: expanded from macro 'dev_err'
           _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                 ~~~     ^~~~~~~~~~~

2 warnings generated.

vim +1329 drivers/perf/arm-cmn.c

1308
1309 static void arm_cmn_init_node_info(struct arm_cmn *cmn, u32 offset, struct arm_cmn_node *node)
1310 {
1311 int level;
1312 u64 reg = readq_relaxed(cmn->base + offset + CMN_NODE_INFO);
1313
1314 node->type = FIELD_GET(CMN_NI_NODE_TYPE, reg);
1315 node->id = FIELD_GET(CMN_NI_NODE_ID, reg);
1316 node->logid = FIELD_GET(CMN_NI_LOGICAL_ID, reg);
1317
1318 node->pmu_base = cmn->base + offset + CMN_PMU_OFFSET;
1319
1320 if (node->type == CMN_TYPE_CFG)
1321 level = 0;
1322 else if (node->type == CMN_TYPE_XP)
1323 level = 1;
1324 else
1325 level = 2;
1326
1327 dev_dbg(cmn->dev, "node%*c%#06hx%*ctype:%-#6hx id:%-4hd off:%#x\n",
1328 (level * 2) + 1, ' ', node->id, 5 - (level * 2), ' ',

> 1329				node->type, node->logid, offset);

1330 }
1331

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