Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

John W. Linville and committed by
David S. Miller
1064e944 b6cbc3b6

+2 -10
+2 -10
drivers/net/bnx2.c
··· 4800 4800 struct bnx2 *bp = dev->priv; 4801 4801 int rc; 4802 4802 4803 - if (eeprom->offset > bp->flash_info->total_size) 4804 - return -EINVAL; 4805 - 4806 - if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size) 4807 - eeprom->len = bp->flash_info->total_size - eeprom->offset; 4803 + /* parameters already validated in ethtool_get_eeprom */ 4808 4804 4809 4805 rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len); 4810 4806 ··· 4814 4818 struct bnx2 *bp = dev->priv; 4815 4819 int rc; 4816 4820 4817 - if (eeprom->offset > bp->flash_info->total_size) 4818 - return -EINVAL; 4819 - 4820 - if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size) 4821 - eeprom->len = bp->flash_info->total_size - eeprom->offset; 4821 + /* parameters already validated in ethtool_set_eeprom */ 4822 4822 4823 4823 rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len); 4824 4824