linux_dsm_epyc7002/drivers/net/ethernet/freescale
Petr Štetiar 2d2924af96 net: ethernet: fix similar warning reported by kbuild test robot
This patch fixes following (similar) warning reported by kbuild test robot:

 In function ‘memcpy’,
  inlined from ‘smsc75xx_init_mac_address’ at drivers/net/usb/smsc75xx.c:778:3,
  inlined from ‘smsc75xx_bind’ at drivers/net/usb/smsc75xx.c:1501:2:
  ./include/linux/string.h:355:9: warning: argument 2 null where non-null expected [-Wnonnull]
  return __builtin_memcpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/net/usb/smsc75xx.c: In function ‘smsc75xx_bind’:
  ./include/linux/string.h:355:9: note: in a call to built-in function ‘__builtin_memcpy’

I've replaced the offending memcpy with ether_addr_copy, because I'm
100% sure, that of_get_mac_address can't return NULL as it returns valid
pointer or ERR_PTR encoded value, nothing else.

I'm hesitant to just change IS_ERR into IS_ERR_OR_NULL check, as this
would make the warning disappear also, but it would be confusing to
check for impossible return value just to make a compiler happy.

I'm now changing all occurencies of memcpy to ether_addr_copy after the
of_get_mac_address call, as it's very likely, that we're going to get
similar reports from kbuild test robot in the future.

Fixes: a51645f70f ("net: ethernet: support of_get_mac_address new ERR_PTR error")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-10 15:14:29 -07:00
..
dpaa dpaa_eth: fix SG frame cleanup 2019-05-05 10:31:33 -07:00
dpaa2 dpaa2-eth: Add flow steering support without masking 2019-04-16 21:46:19 -07:00
enetc enetc: Add ENETC PF level external MDIO support 2019-03-01 11:21:32 -08:00
fman net: ethernet: fix similar warning reported by kbuild test robot 2019-05-10 15:14:29 -07:00
fs_enet net: ethernet: fix similar warning reported by kbuild test robot 2019-05-10 15:14:29 -07:00
fec_main.c net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
fec_mpc52xx_phy.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
fec_mpc52xx.c net: ethernet: fix similar warning reported by kbuild test robot 2019-05-10 15:14:29 -07:00
fec_mpc52xx.h
fec_ptp.c net: fec: remove redundant variable 'inc' 2018-07-04 22:39:11 +09:00
fec.h net: fec: remove workaround to restart phylib state machine on MDIO timeout 2018-12-18 15:01:55 -08:00
fsl_pq_mdio.c net: fsl: Use device_type helpers to access the node type 2018-11-17 21:52:58 -08:00
gianfar_ethtool.c ptp_qoriq: make structure/function names more consistent 2019-02-12 12:58:47 -05:00
gianfar.c net: ethernet: fix similar warning reported by kbuild test robot 2019-05-10 15:14:29 -07:00
gianfar.h net: ethernet: gianfar_ethtool: get phc index through drvdata 2018-05-28 23:05:11 -04:00
Kconfig enetc: Introduce basic PF and VF ENETC ethernet drivers 2019-01-24 21:55:53 -08:00
Makefile enetc: Introduce basic PF and VF ENETC ethernet drivers 2019-01-24 21:55:53 -08:00
ucc_geth_ethtool.c net: ucc_geth - fix Oops when changing number of buffers in the ring 2019-05-05 10:33:01 -07:00
ucc_geth.c net: ethernet: fix similar warning reported by kbuild test robot 2019-05-10 15:14:29 -07:00
ucc_geth.h QE: Move QE from arch/powerpc to drivers/soc 2015-12-22 17:12:56 -06:00
xgmac_mdio.c net/fsl: use of_property_read_bool 2016-08-08 16:15:00 -07:00