Skip to content

Commit

Permalink
[BNX2]: simplify parameter checks in bnx2_{get,set}_eeprom
Browse files Browse the repository at this point in the history
Remove the superfluous parameter checking in bnx2_{get,set}_eeprom.
The parameters are already validated in ethtool_{get,set}_eeprom.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
John W. Linville authored and David S. Miller committed Nov 10, 2005
1 parent b6cbc3b commit 1064e94
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4800,11 +4800,7 @@ bnx2_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
struct bnx2 *bp = dev->priv;
int rc;

if (eeprom->offset > bp->flash_info->total_size)
return -EINVAL;

if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
eeprom->len = bp->flash_info->total_size - eeprom->offset;
/* parameters already validated in ethtool_get_eeprom */

rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);

Expand All @@ -4818,11 +4814,7 @@ bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
struct bnx2 *bp = dev->priv;
int rc;

if (eeprom->offset > bp->flash_info->total_size)
return -EINVAL;

if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
eeprom->len = bp->flash_info->total_size - eeprom->offset;
/* parameters already validated in ethtool_set_eeprom */

rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len);

Expand Down

0 comments on commit 1064e94

Please sign in to comment.