Subject: Re: [PATCH 2/2] net: phy: dp83867: add support for changing LED modes

From: kernel test robot <[email-masked]>
Date: Sat, 20 Mar 2021 11:41:33 +0800

Hi Michael,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on net/master ipvs/master net-next/master v5.12-rc3 next-20210319]
[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]

url:    https://github.com/0day-ci/linux/commits/Michael-Tretter/net-phy-dp83867-Configure-LED-modes-via-device-tree/20210320-000027
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm-randconfig-r023-20210318 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project fcc1ce00931751ac02498986feb37744e9ace8de)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/740c2de62bc36c66a54a8c152a65ae2ebf805515
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Michael-Tretter/net-phy-dp83867-Configure-LED-modes-via-device-tree/20210320-000027
        git checkout 740c2de62bc36c66a54a8c152a65ae2ebf805515
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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/phy/dp83867.c:550:14: warning: incompatible integer to pointer conversion passing 'u32' (aka 'unsigned int') to parameter of type 'u32 *' (aka 'unsigned int *'); take the address with & [-Wint-conversion]
                                            index, tmp);
                                                   ^~~
                                                   &
   include/linux/of.h:311:28: note: passing argument to parameter 'out_value' here
                                          u32 index, u32 *out_value);
                                                          ^
>> drivers/net/phy/dp83867.c:550:14: warning: variable 'tmp' is uninitialized when used here [-Wuninitialized]
                                            index, tmp);
                                                   ^~~
   drivers/net/phy/dp83867.c:543:9: note: initialize the variable 'tmp' to silence this warning
           u32 tmp;
                  ^
                   = 0
   2 warnings generated.

vim +550 drivers/net/phy/dp83867.c

   538	
   539	#if IS_ENABLED(CONFIG_OF_MDIO)
   540	static int dp83867_of_led_mode_read(struct device_node *of_node,
   541					    const char *led_name, u32 *mode)
   542	{
   543		u32 tmp;
   544		int index;
   545		int err;
   546	
   547		index = of_property_match_string(of_node, "ti,dp83867-led-mode-names",
   548						 led_name);
   549		err = of_property_read_u32_index(of_node, "ti,dp83867-led-modes",
 > 550						 index, tmp);
   551		if (err)
   552			return err;
   553		if (tmp == 0xc || tmp >= 0xf)
   554			return -EINVAL;
   555	
   556		*mode = tmp;
   557	
   558		return 0;
   559	}
   560	

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