summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-05-14 13:00:17 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 23:32:23 +0200
commit275782311ca05f879a366691ceaba4e8ed643fec (patch)
tree13428e3c27a9512c7febeee050f8b75a40250cb3
parentdd6f8d712e927397da27f2a3d90a759eeac4f694 (diff)
downloaddpdk-275782311ca05f879a366691ceaba4e8ed643fec.zip
dpdk-275782311ca05f879a366691ceaba4e8ed643fec.tar.gz
dpdk-275782311ca05f879a366691ceaba4e8ed643fec.tar.xz
net/axgbe: fix EEPROM string comparison
drivers/net/axgbe/axgbe_phy_impl.c:576:6: error: ‘__builtin_memcmp_eq’ reading 16 bytes from a region of size 9 [-Werror=stringop-overflow=] if (memcmp(&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_NAME], ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AXGBE_BEL_FUSE_VENDOR, AXGBE_SFP_BASE_VENDOR_NAME_LEN)) Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs") Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
-rw-r--r--drivers/net/axgbe/axgbe_phy_impl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index dfa908d..973177f 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -574,11 +574,11 @@ static bool axgbe_phy_belfuse_parse_quirks(struct axgbe_port *pdata)
struct axgbe_sfp_eeprom *sfp_eeprom = &phy_data->sfp_eeprom;
if (memcmp(&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_NAME],
- AXGBE_BEL_FUSE_VENDOR, AXGBE_SFP_BASE_VENDOR_NAME_LEN))
+ AXGBE_BEL_FUSE_VENDOR, strlen(AXGBE_BEL_FUSE_VENDOR)))
return false;
if (!memcmp(&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_PN],
- AXGBE_BEL_FUSE_PARTNO, AXGBE_SFP_BASE_VENDOR_PN_LEN)) {
+ AXGBE_BEL_FUSE_PARTNO, strlen(AXGBE_BEL_FUSE_PARTNO))) {
phy_data->sfp_base = AXGBE_SFP_BASE_1000_SX;
phy_data->sfp_cable = AXGBE_SFP_CABLE_ACTIVE;
phy_data->sfp_speed = AXGBE_SFP_SPEED_1000;