]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: cleanup - check return values consistently
authorBruce Allan <bruce.w.allan@intel.com>
Tue, 31 Jan 2012 06:37:27 +0000 (06:37 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 07:21:37 +0000 (15:21 +0800)
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.

(cherry picked from commit 9e2d7657e2a8fb40f732563dffb05151ea2d7e01)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/ich8lan.c

index f95cbfdb371161a2bcdf16689776830fa9b93591..4466b0ec011d8d0ea22644ae09962d4ea97e21b0 100644 (file)
@@ -537,7 +537,7 @@ static int e1000_set_eeprom(struct net_device *netdev,
                ret_val = e1000_read_nvm(hw, first_word, 1, &eeprom_buff[0]);
                ptr++;
        }
-       if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0))
+       if (((eeprom->offset + eeprom->len) & 1) && (!ret_val))
                /* need read/modify/write of last changed EEPROM word */
                /* only the first byte of the word is being modified */
                ret_val = e1000_read_nvm(hw, last_word, 1,
index eb05de1b99775aae2d5584d126a1afdbe6ad4607..57e91f9c3ae15def6d52a7f32bd1bcd2008e7910 100644 (file)
@@ -2282,7 +2282,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
                        }
                        udelay(1);
                }
-               if (ret_val == 0) {
+               if (!ret_val) {
                        /*
                         * Successful in waiting for previous cycle to timeout,
                         * now set the Flash Cycle Done.
@@ -2400,7 +2400,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
                udelay(1);
                /* Steps */
                ret_val = e1000_flash_cycle_init_ich8lan(hw);
-               if (ret_val != 0)
+               if (ret_val)
                        break;
 
                hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
@@ -2420,7 +2420,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
                 * read in (shift in) the Flash Data0, the order is
                 * least significant byte first msb to lsb
                 */
-               if (ret_val == 0) {
+               if (!ret_val) {
                        flash_data = er32flash(ICH_FLASH_FDATA0);
                        if (size == 1)
                                *data = (u8)(flash_data & 0x000000FF);
@@ -2932,7 +2932,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
 
                        ret_val = e1000_flash_cycle_ich8lan(hw,
                                               ICH_FLASH_ERASE_COMMAND_TIMEOUT);
-                       if (ret_val == 0)
+                       if (!ret_val)
                                break;
 
                        /*