diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2012-01-31 01:37:27 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-02-07 07:10:07 -0500 |
commit | 9e2d7657e2a8fb40f732563dffb05151ea2d7e01 (patch) | |
tree | 73dfa5a48cffa79c6bdc54994a5fcb71c7a5aeee | |
parent | f36bb6cacd3bcbab9605e06f585ee8f1ea450876 (diff) |
e1000e: cleanup - check return values consistently
The majority of the e1000e code checks most function return values using a
test like 'if (ret_val)' or 'if (!ret_val)' but there are a few instances
of 'if (ret_val == 0)'. This patch converts the latter to the former for
consistency.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ich8lan.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 92d5b6278955..f43af463ddc6 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c | |||
@@ -537,7 +537,7 @@ static int e1000_set_eeprom(struct net_device *netdev, | |||
537 | ret_val = e1000_read_nvm(hw, first_word, 1, &eeprom_buff[0]); | 537 | ret_val = e1000_read_nvm(hw, first_word, 1, &eeprom_buff[0]); |
538 | ptr++; | 538 | ptr++; |
539 | } | 539 | } |
540 | if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) | 540 | if (((eeprom->offset + eeprom->len) & 1) && (!ret_val)) |
541 | /* need read/modify/write of last changed EEPROM word */ | 541 | /* need read/modify/write of last changed EEPROM word */ |
542 | /* only the first byte of the word is being modified */ | 542 | /* only the first byte of the word is being modified */ |
543 | ret_val = e1000_read_nvm(hw, last_word, 1, | 543 | ret_val = e1000_read_nvm(hw, last_word, 1, |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 907b17b2e66a..0e64cc438494 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -2286,7 +2286,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) | |||
2286 | } | 2286 | } |
2287 | udelay(1); | 2287 | udelay(1); |
2288 | } | 2288 | } |
2289 | if (ret_val == 0) { | 2289 | if (!ret_val) { |
2290 | /* | 2290 | /* |
2291 | * Successful in waiting for previous cycle to timeout, | 2291 | * Successful in waiting for previous cycle to timeout, |
2292 | * now set the Flash Cycle Done. | 2292 | * now set the Flash Cycle Done. |
@@ -2404,7 +2404,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, | |||
2404 | udelay(1); | 2404 | udelay(1); |
2405 | /* Steps */ | 2405 | /* Steps */ |
2406 | ret_val = e1000_flash_cycle_init_ich8lan(hw); | 2406 | ret_val = e1000_flash_cycle_init_ich8lan(hw); |
2407 | if (ret_val != 0) | 2407 | if (ret_val) |
2408 | break; | 2408 | break; |
2409 | 2409 | ||
2410 | hsflctl.regval = er16flash(ICH_FLASH_HSFCTL); | 2410 | hsflctl.regval = er16flash(ICH_FLASH_HSFCTL); |
@@ -2424,7 +2424,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, | |||
2424 | * read in (shift in) the Flash Data0, the order is | 2424 | * read in (shift in) the Flash Data0, the order is |
2425 | * least significant byte first msb to lsb | 2425 | * least significant byte first msb to lsb |
2426 | */ | 2426 | */ |
2427 | if (ret_val == 0) { | 2427 | if (!ret_val) { |
2428 | flash_data = er32flash(ICH_FLASH_FDATA0); | 2428 | flash_data = er32flash(ICH_FLASH_FDATA0); |
2429 | if (size == 1) | 2429 | if (size == 1) |
2430 | *data = (u8)(flash_data & 0x000000FF); | 2430 | *data = (u8)(flash_data & 0x000000FF); |
@@ -2936,7 +2936,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) | |||
2936 | 2936 | ||
2937 | ret_val = e1000_flash_cycle_ich8lan(hw, | 2937 | ret_val = e1000_flash_cycle_ich8lan(hw, |
2938 | ICH_FLASH_ERASE_COMMAND_TIMEOUT); | 2938 | ICH_FLASH_ERASE_COMMAND_TIMEOUT); |
2939 | if (ret_val == 0) | 2939 | if (!ret_val) |
2940 | break; | 2940 | break; |
2941 | 2941 | ||
2942 | /* | 2942 | /* |