Re: [PATCH v4 net-next 5/6] net: dsa: mv88e6xxx: mac-auth/MAB implementation

From: kernel test robot
Date: Fri Jul 08 2022 - 05:46:50 EST


Hi Hans,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]
[also build test WARNING on shuah-kselftest/next linus/master v5.19-rc5]
[cannot apply to net-next/master next-20220707]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Hans-Schultz/Extend-locked-port-feature-with-FDB-locked-flag-MAC-Auth-MAB/20220707-233246
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 07266d066301b97ad56a693f81b29b7ced429b27
config: x86_64-randconfig-a005 (https://download.01.org/0day-ci/archive/20220708/202207081751.PPV8GRpf-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 562c3467a6738aa89203f72fc1d1343e5baadf3c)
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/intel-lab-lkp/linux/commit/74f76ae0b0d4b12864a0cf5ff3c0685bc420aea3
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Hans-Schultz/Extend-locked-port-feature-with-FDB-locked-flag-MAC-Auth-MAB/20220707-233246
git checkout 74f76ae0b0d4b12864a0cf5ff3c0685bc420aea3
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/dsa/mv88e6xxx/

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

All warnings (new ones prefixed by >>):

>> drivers/net/dsa/mv88e6xxx/chip.c:1696:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (mv88e6xxx_port_is_locked(chip, port))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/chip.c:1698:6: note: uninitialized use occurs here
if (err)
^~~
drivers/net/dsa/mv88e6xxx/chip.c:1696:2: note: remove the 'if' if its condition is always true
if (mv88e6xxx_port_is_locked(chip, port))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/chip.c:1694:9: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
1 warning generated.


vim +1696 drivers/net/dsa/mv88e6xxx/chip.c

1690
1691 static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)
1692 {
1693 struct mv88e6xxx_chip *chip = ds->priv;
1694 int err;
1695
> 1696 if (mv88e6xxx_port_is_locked(chip, port))
1697 err = mv88e6xxx_atu_locked_entry_flush(ds, port);
1698 if (err)
1699 dev_err(chip->ds->dev, "p%d: failed to clear locked entries: %d\n",
1700 port, err);
1701
1702 mv88e6xxx_reg_lock(chip);
1703 err = mv88e6xxx_port_fast_age_fid(chip, port, 0);
1704 mv88e6xxx_reg_unlock(chip);
1705
1706 if (err)
1707 dev_err(chip->ds->dev, "p%d: failed to flush ATU: %d\n",
1708 port, err);
1709 }
1710

--
0-DAY CI Kernel Test Service
https://01.org/lkp