Subject: Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: return error instead of lane in .serdes_get_lane

From: kernel test robot <[email-masked]>
Date: Thu, 20 Aug 2020 06:12:53 +0800

Hi "Marek,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Marek-Beh-n/net-dsa-mv88e6xxx-Add-Amethyst-88E6393X/20200819-234008
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git e3ec1e8ca02b7e6c935bba3f9b6da86c2e57d2eb
config: x86_64-randconfig-a006-20200818 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b34b1e38381fa4d1b1d9751a6b5233b68e734cfe)
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
        # 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 <[email-masked]>

All warnings (new ones prefixed by >>):

>> drivers/net/dsa/mv88e6xxx/serdes.c:428:15: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
           return *lane == -1 ? -ENODEV : 0;
                  ~~~~~ ^  ~~
   drivers/net/dsa/mv88e6xxx/serdes.c:451:15: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
           return *lane == -1 ? -ENODEV : 0;
                  ~~~~~ ^  ~~
   drivers/net/dsa/mv88e6xxx/serdes.c:526:15: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
           return *lane == -1 ? -ENODEV : 0;
                  ~~~~~ ^  ~~
   3 warnings generated.

# https://github.com/0day-ci/linux/commit/a63db5e9b7db608109e7a315dfde9e57df682a20
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/net-dsa-mv88e6xxx-Add-Amethyst-88E6393X/20200819-234008
git checkout a63db5e9b7db608109e7a315dfde9e57df682a20
vim +428 drivers/net/dsa/mv88e6xxx/serdes.c

   413	
   414	int mv88e6341_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
   415	{
   416		u8 cmode = chip->ports[port].cmode;
   417	
   418		*lane = -1;
   419		switch (port) {
   420		case 5:
   421			if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
   422			    cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
   423			    cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
   424				*lane = MV88E6341_PORT5_LANE;
   425			break;
   426		}
   427	
 > 428		return *lane == -1 ? -ENODEV : 0;
   429	}
   430	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email-masked]