Commit 1064e944 authored by John W. Linville's avatar John W. Linville Committed by David S. Miller

[BNX2]: simplify parameter checks in bnx2_{get,set}_eeprom

Remove the superfluous parameter checking in bnx2_{get,set}_eeprom.
The parameters are already validated in ethtool_{get,set}_eeprom.
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b6cbc3b6
...@@ -4800,11 +4800,7 @@ bnx2_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -4800,11 +4800,7 @@ bnx2_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
struct bnx2 *bp = dev->priv; struct bnx2 *bp = dev->priv;
int rc; int rc;
if (eeprom->offset > bp->flash_info->total_size) /* parameters already validated in ethtool_get_eeprom */
return -EINVAL;
if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
eeprom->len = bp->flash_info->total_size - eeprom->offset;
rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len); rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);
...@@ -4818,11 +4814,7 @@ bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -4818,11 +4814,7 @@ bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
struct bnx2 *bp = dev->priv; struct bnx2 *bp = dev->priv;
int rc; int rc;
if (eeprom->offset > bp->flash_info->total_size) /* parameters already validated in ethtool_set_eeprom */
return -EINVAL;
if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
eeprom->len = bp->flash_info->total_size - eeprom->offset;
rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len); rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment