Tue, Jun 16, 2020 at 10:21:24PM CEST, lkp(a)intel.com wrote:
tree:
https://github.com/jpirko/linux_mlxsw net_next_queue
head: f57f2148543db358708e16537ab5c87f5da6abba
commit: 9cc195db08f0779fe92deac4da99879d95d8fe96 [21/27] devlink: Replace
devlink_port_attrs_set parameters with a struct
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
487ca07fcc75d52755c9fe2ee05bcb3b6eeeec44)
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
git checkout 9cc195db08f0779fe92deac4da99879d95d8fe96
# 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
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> net/core/devlink.c:7388:23: warning: address of array
'attrs->switch_id.id' will always evaluate to 'true'
[-Wpointer-bool-conversion]
if (attrs->switch_id.id) {
~~ ~~~~~~~~~~~~~~~~~^~
1 warning generated.
vim +7388 net/core/devlink.c
7378
7379 static int __devlink_port_attrs_set(struct devlink_port *devlink_port,
7380 enum devlink_port_flavour flavour)
7381 {
7382 struct devlink_port_attrs *attrs = &devlink_port->attrs;
7383
7384 if (WARN_ON(devlink_port->registered))
7385 return -EEXIST;
7386 devlink_port->attrs_set = true;
7387 attrs->flavour = flavour;
> 7388 if (attrs->switch_id.id) {
Ha, I missed this during review. You need to check id_len
7389 devlink_port->switch_port = true;
7390 if (WARN_ON(attrs->switch_id.id_len > MAX_PHYS_ITEM_ID_LEN))
7391 attrs->switch_id.id_len = MAX_PHYS_ITEM_ID_LEN;
7392 } else {
7393 devlink_port->switch_port = false;
7394 }
7395 return 0;
7396 }
7397
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org