[lunn:v5.15-rc1-net-mv88e6161-mtu 4/4] drivers/net/dsa/mv88e6xxx/port.c:1280:29: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t' {aka 'long unsigned int'}

From: kernel test robot
Date: Mon Sep 20 2021 - 00:58:44 EST


tree: https://github.com/lunn/linux.git v5.15-rc1-net-mv88e6161-mtu
head: edfa13dec25e22ef6404588b86932dd161bdb8c0
commit: edfa13dec25e22ef6404588b86932dd161bdb8c0 [4/4] DEBUG
config: alpha-randconfig-r002-20210920 (attached as .config)
compiler: alpha-linux-gcc (GCC) 11.2.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://github.com/lunn/linux/commit/edfa13dec25e22ef6404588b86932dd161bdb8c0
git remote add lunn https://github.com/lunn/linux.git
git fetch --no-tags lunn v5.15-rc1-net-mv88e6161-mtu
git checkout edfa13dec25e22ef6404588b86932dd161bdb8c0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=alpha

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/dma-mapping.h:7,
from include/linux/skbuff.h:31,
from include/net/net_namespace.h:39,
from include/linux/netdevice.h:37,
from include/linux/if_bridge.h:12,
from drivers/net/dsa/mv88e6xxx/port.c:12:
drivers/net/dsa/mv88e6xxx/port.c: In function 'mv88e6165_port_set_jumbo_size':
>> drivers/net/dsa/mv88e6xxx/port.c:1280:29: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
1280 | dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~
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:150:58: note: in expansion of macro 'dev_fmt'
150 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/net/dsa/mv88e6xxx/port.c:1280:9: note: in expansion of macro 'dev_info'
1280 | dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
| ^~~~~~~~
drivers/net/dsa/mv88e6xxx/port.c:1280:49: note: format string is defined here
1280 | dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
| ~^
| |
| int
| %ld
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from include/linux/skbuff.h:31,
from include/net/net_namespace.h:39,
from include/linux/netdevice.h:37,
from include/linux/if_bridge.h:12,
from drivers/net/dsa/mv88e6xxx/port.c:12:
drivers/net/dsa/mv88e6xxx/port.c:1284:29: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
1284 | dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~
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:150:58: note: in expansion of macro 'dev_fmt'
150 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/net/dsa/mv88e6xxx/port.c:1284:9: note: in expansion of macro 'dev_info'
1284 | dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
| ^~~~~~~~
drivers/net/dsa/mv88e6xxx/port.c:1284:49: note: format string is defined here
1284 | dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
| ~^
| |
| int
| %ld


vim +1280 drivers/net/dsa/mv88e6xxx/port.c

1273
1274 int mv88e6165_port_set_jumbo_size(struct mv88e6xxx_chip *chip, int port,
1275 size_t size)
1276 {
1277 u16 reg;
1278 int err;
1279
> 1280 dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
1281
1282 size += VLAN_ETH_HLEN + ETH_FCS_LEN;
1283
1284 dev_info(chip->dev, "%s: port %d, size %d\n", __func__, port, size);
1285
1286 err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_CTL2, &reg);
1287 dev_info(chip->dev, "%s: %4x\n", __func__, reg);
1288 if (err)
1289 return err;
1290
1291 reg &= ~MV88E6XXX_PORT_CTL2_JUMBO_MODE_MASK;
1292
1293 if (size <= 1522)
1294 reg |= MV88E6XXX_PORT_CTL2_JUMBO_MODE_1522;
1295 else if (size <= 2048)
1296 reg |= MV88E6XXX_PORT_CTL2_JUMBO_MODE_2048;
1297 else if (size <= 10240)
1298 reg |= MV88E6XXX_PORT_CTL2_JUMBO_MODE_10240;
1299 else {
1300 dev_info(chip->dev, "Invalid size\n");
1301 return -ERANGE;
1302 }
1303 dev_info(chip->dev, "%s: %4x\n", __func__, reg);
1304
1305 return mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_CTL2, reg);
1306 }
1307

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

Attachment: .config.gz
Description: application/gzip