public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [kuba:dev_addr 20/23] drivers/base/property.c:1016:16: warning: function may return address of local variable
@ 2021-10-07  8:00 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-07  8:00 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2303 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux.git dev_addr
head:   973ae9d60a15efacbd36aa6095c34871f3147ca0
commit: c419c9d578ca5ac351185b8cc448d12236aebf55 [20/23] device property: add a helper for loading netdev->dev_addr
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-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://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux.git/commit/?id=c419c9d578ca5ac351185b8cc448d12236aebf55
        git remote add kuba https://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux.git
        git fetch --no-tags kuba dev_addr
        git checkout c419c9d578ca5ac351185b8cc448d12236aebf55
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64 

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

All warnings (new ones prefixed by >>):

   drivers/base/property.c: In function 'device_get_ethdev_addr':
>> drivers/base/property.c:1016:16: warning: function may return address of local variable [-Wreturn-local-addr]
    1016 |         return ret;
         |                ^~~
   drivers/base/property.c:1010:12: note: declared here
    1010 |         u8 addr[ETH_ALEN];
         |            ^~~~


vim +1016 drivers/base/property.c

   999	
  1000	/**
  1001	 * device_get_ethdev_addr - Set netdev's MAC address from a given device
  1002	 * @dev:	Pointer to the device
  1003	 * @netdev:	Pointer to netdev to write the address to
  1004	 *
  1005	 * Wrapper around device_get_mac_address() which writes the address
  1006	 * directly to netdev->dev_addr.
  1007	 */
  1008	void *device_get_ethdev_addr(struct device *dev, struct net_device *netdev)
  1009	{
  1010		u8 addr[ETH_ALEN];
  1011		void *ret;
  1012	
  1013		ret = device_get_mac_address(dev, addr, ETH_ALEN);
  1014		if (ret)
  1015			eth_hw_addr_set(netdev, addr);
> 1016		return ret;
  1017	}
  1018	EXPORT_SYMBOL(device_get_ethdev_addr);
  1019	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 19973 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-07  8:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-07  8:00 [kuba:dev_addr 20/23] drivers/base/property.c:1016:16: warning: function may return address of local variable kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox