[jpirko-mlxsw:jiri_devel_linecards 38/39] drivers/net/netdevsim/dev.c:119:57: error: passing argument 4 of 'devlink_linecard_device_create' from incompatible pointer type

From: kernel test robot
Date: Tue Mar 01 2022 - 16:14:36 EST


tree: https://github.com/jpirko/linux_mlxsw jiri_devel_linecards
head: fcef7b383481be9b69822d4d795df70f382f78f1
commit: 6db26604520f23b4189cb7979bfceea51678df22 [38/39] TMP: devlink device type
config: arc-randconfig-r021-20220301 (https://download.01.org/0day-ci/archive/20220302/202203020522.M9GYd0HL-lkp@xxxxxxxxx/config)
compiler: arc-elf-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/jpirko/linux_mlxsw/commit/6db26604520f23b4189cb7979bfceea51678df22
git remote add jpirko-mlxsw https://github.com/jpirko/linux_mlxsw
git fetch --no-tags jpirko-mlxsw jiri_devel_linecards
git checkout 6db26604520f23b4189cb7979bfceea51678df22
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/net/netdevsim/

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

All errors (new ones prefixed by >>):

drivers/net/netdevsim/dev.c: In function 'nsim_dev_linecard_devices_create':
>> drivers/net/netdevsim/dev.c:119:57: error: passing argument 4 of 'devlink_linecard_device_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
119 | nsim_dev_linecard);
| ^~~~~~~~~~~~~~~~~
| |
| struct nsim_dev_linecard *
In file included from drivers/net/netdevsim/dev.c:29:
include/net/devlink.h:1580:44: note: expected 'const char *' but argument is of type 'struct nsim_dev_linecard *'
1580 | const char *type, void *priv);
| ~~~~~~~~~~~~^~~~
>> drivers/net/netdevsim/dev.c:117:26: error: too few arguments to function 'devlink_linecard_device_create'
117 | device = devlink_linecard_device_create(nsim_dev_linecard->devlink_linecard,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/netdevsim/dev.c:29:
include/net/devlink.h:1577:1: note: declared here
1577 | devlink_linecard_device_create(struct devlink_linecard *linecard,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/devlink_linecard_device_create +119 drivers/net/netdevsim/dev.c

d75afab460832e Jiri Pirko 2021-05-05 100
d75afab460832e Jiri Pirko 2021-05-05 101 static int
d75afab460832e Jiri Pirko 2021-05-05 102 nsim_dev_linecard_devices_create(struct nsim_dev_linecard *nsim_dev_linecard)
d75afab460832e Jiri Pirko 2021-05-05 103 {
d75afab460832e Jiri Pirko 2021-05-05 104 struct devlink_linecard_device *device;
d75afab460832e Jiri Pirko 2021-05-05 105 char *component_name;
d75afab460832e Jiri Pirko 2021-05-05 106 int err;
d75afab460832e Jiri Pirko 2021-05-05 107 int i;
d75afab460832e Jiri Pirko 2021-05-05 108
d75afab460832e Jiri Pirko 2021-05-05 109 snprintf(nsim_dev_linecard->device_component_name,
d75afab460832e Jiri Pirko 2021-05-05 110 sizeof(nsim_dev_linecard->device_component_name), "lc%u_dev0",
d75afab460832e Jiri Pirko 2021-05-05 111 nsim_dev_linecard->linecard_index);
d75afab460832e Jiri Pirko 2021-05-05 112 component_name = nsim_dev_linecard->device_component_name;
d75afab460832e Jiri Pirko 2021-05-05 113
d75afab460832e Jiri Pirko 2021-05-05 114 for (i = 0; i < NSIM_DEV_LINECARD_DEVICE_COUNT; i++) {
d75afab460832e Jiri Pirko 2021-05-05 115 if (i > 0)
d75afab460832e Jiri Pirko 2021-05-05 116 component_name = NULL;
d75afab460832e Jiri Pirko 2021-05-05 @117 device = devlink_linecard_device_create(nsim_dev_linecard->devlink_linecard,
d75afab460832e Jiri Pirko 2021-05-05 118 i, component_name,
d75afab460832e Jiri Pirko 2021-05-05 @119 nsim_dev_linecard);
d75afab460832e Jiri Pirko 2021-05-05 120 if (IS_ERR(device)) {
d75afab460832e Jiri Pirko 2021-05-05 121 err = PTR_ERR(device);
d75afab460832e Jiri Pirko 2021-05-05 122 goto rollback;
d75afab460832e Jiri Pirko 2021-05-05 123 }
d75afab460832e Jiri Pirko 2021-05-05 124 nsim_dev_linecard->devlink_device[i] = device;
d75afab460832e Jiri Pirko 2021-05-05 125 }
d75afab460832e Jiri Pirko 2021-05-05 126 return 0;
d75afab460832e Jiri Pirko 2021-05-05 127
d75afab460832e Jiri Pirko 2021-05-05 128 rollback:
d75afab460832e Jiri Pirko 2021-05-05 129 for (i--; i >= 0; i--) {
d75afab460832e Jiri Pirko 2021-05-05 130 device = nsim_dev_linecard->devlink_device[i];
d75afab460832e Jiri Pirko 2021-05-05 131 devlink_linecard_device_destroy(nsim_dev_linecard->devlink_linecard,
d75afab460832e Jiri Pirko 2021-05-05 132 device);
d75afab460832e Jiri Pirko 2021-05-05 133 }
d75afab460832e Jiri Pirko 2021-05-05 134 return err;
d75afab460832e Jiri Pirko 2021-05-05 135 }
d75afab460832e Jiri Pirko 2021-05-05 136

:::::: The code at line 119 was first introduced by commit
:::::: d75afab460832ea5abcbfe1d3e7107a44e648046 netdevsim: create couple of devices on each linecard

:::::: TO: Jiri Pirko <jiri@xxxxxxxxxx>
:::::: CC: Jiri Pirko <jiri@xxxxxxxxxx>

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