summaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2005-11-10 12:58:24 -0800
committerDavid S. Miller <davem@davemloft.net>2005-11-10 12:58:24 -0800
commit1064e944d03eb7a72c0fa11236d5e69cfd877a71 (patch)
tree719c11a7284a0255cd7875414dd52769b820933f /drivers/net/bnx2.c
parentb6cbc3b6fe588c0ea1341d10413e12c2a96a6032 (diff)
[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: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 32267d538b1..49fa1e4413f 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -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);
@@ -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);