lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 1/2] of: net: move nvmem_get_mac_address() into of_get_mac_addr_nvmem()
Hi Yajun,

Thank you for the patch! Yet something to improve:

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

url: https://github.com/0day-ci/linux/commits/Yajun-Deng/of-net-move-nvmem_get_mac_address-into-of_get_mac_addr_nvmem/20211013-162802
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d1f24712a86abd04d82cf4b00fb4ab8ff2d23c8a
config: i386-buildonly-randconfig-r002-20211013 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a8c695542b2987eb9a203d5663a0740cb4725f)
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/0day-ci/linux/commit/10748c5429eced2d22c6cf10e8dcdef8a1a5c38d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yajun-Deng/of-net-move-nvmem_get_mac_address-into-of_get_mac_addr_nvmem/20211013-162802
git checkout 10748c5429eced2d22c6cf10e8dcdef8a1a5c38d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386

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

All errors (new ones prefixed by >>):

>> net/core/of_net.c:66:6: error: unused variable 'ret' [-Werror,-Wunused-variable]
int ret;
^
1 error generated.


vim +/ret +66 net/core/of_net.c

3eb46a1da78dff drivers/of/of_net.c Sergei Shtylyov 2015-03-18 59
83216e3988cd19 drivers/of/of_net.c Michael Walle 2021-04-12 60 static int of_get_mac_addr_nvmem(struct device_node *np, u8 *addr)
d01f449c008a3f drivers/of/of_net.c Petr Štetiar 2019-05-03 61 {
d01f449c008a3f drivers/of/of_net.c Petr Štetiar 2019-05-03 62 struct platform_device *pdev = of_find_device_by_node(np);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 63 struct nvmem_cell *cell;
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 64 const void *mac;
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 65 size_t len;
83216e3988cd19 drivers/of/of_net.c Michael Walle 2021-04-12 @66 int ret;
d01f449c008a3f drivers/of/of_net.c Petr Štetiar 2019-05-03 67
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 68 /* Try lookup by device first, there might be a nvmem_cell_lookup
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 69 * associated with a given device.
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 70 */
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 71 if (pdev)
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 72 cell = nvmem_cell_get(&pdev->dev, "mac-address");
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 73 else
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 74 cell = of_nvmem_cell_get(np, "mac-address");
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 75
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 76 if (IS_ERR(cell))
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 77 return PTR_ERR(cell);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 78
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 79 mac = nvmem_cell_read(cell, &len);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 80 nvmem_cell_put(cell);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 81
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 82 if (IS_ERR(mac))
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 83 return PTR_ERR(mac);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 84
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 85 if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 86 kfree(mac);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 87 return -EINVAL;
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 88 }
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 89
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 90 ether_addr_copy(addr, mac);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 91 kfree(mac);
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 92
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 93 if (pdev)
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 94 put_device(&pdev->dev);
10748c5429eced net/core/of_net.c Yajun Deng 2021-10-13 95
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 96 return 0;
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 97 }
f10843e04a0752 drivers/of/of_net.c Michael Walle 2021-04-12 98

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-10-13 21:17    [W:0.053 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site