e1000: drop unnecessary constant casts to u16
Remove unnecessary casts of constant values to u16. C's integer promotion rules make them ints no matter what. Additionally replace E1000_MNG_VLAN_NONE with resulting value rather than casting -1 to u16. Signed-off-by: Jacek Kowalski <jacek@jacekk.info> Suggested-by: Simon Horman <horms@kernel.org> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
d07176252a
commit
fa8a9346f9
|
|
@ -116,7 +116,7 @@ struct e1000_adapter;
|
|||
#define E1000_MASTER_SLAVE e1000_ms_hw_default
|
||||
#endif
|
||||
|
||||
#define E1000_MNG_VLAN_NONE (-1)
|
||||
#define E1000_MNG_VLAN_NONE 0xFFFF
|
||||
|
||||
/* wrapper around a pointer to a socket buffer,
|
||||
* so a DMA handle can be stored along with the buffer
|
||||
|
|
|
|||
|
|
@ -806,7 +806,7 @@ static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
|
|||
}
|
||||
|
||||
/* If Checksum is not Correct return error else test passed */
|
||||
if ((checksum != (u16)EEPROM_SUM) && !(*data))
|
||||
if (checksum != EEPROM_SUM && !(*data))
|
||||
*data = 2;
|
||||
|
||||
return *data;
|
||||
|
|
|
|||
|
|
@ -3970,7 +3970,7 @@ s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw)
|
|||
return E1000_SUCCESS;
|
||||
|
||||
#endif
|
||||
if (checksum == (u16)EEPROM_SUM)
|
||||
if (checksum == EEPROM_SUM)
|
||||
return E1000_SUCCESS;
|
||||
else {
|
||||
e_dbg("EEPROM Checksum Invalid\n");
|
||||
|
|
@ -3997,7 +3997,7 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw)
|
|||
}
|
||||
checksum += eeprom_data;
|
||||
}
|
||||
checksum = (u16)EEPROM_SUM - checksum;
|
||||
checksum = EEPROM_SUM - checksum;
|
||||
if (e1000_write_eeprom(hw, EEPROM_CHECKSUM_REG, 1, &checksum) < 0) {
|
||||
e_dbg("EEPROM Write Error\n");
|
||||
return -E1000_ERR_EEPROM;
|
||||
|
|
|
|||
|
|
@ -313,8 +313,7 @@ static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
|
|||
} else {
|
||||
adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
|
||||
}
|
||||
if ((old_vid != (u16)E1000_MNG_VLAN_NONE) &&
|
||||
(vid != old_vid) &&
|
||||
if (old_vid != E1000_MNG_VLAN_NONE && vid != old_vid &&
|
||||
!test_bit(old_vid, adapter->active_vlans))
|
||||
e1000_vlan_rx_kill_vid(netdev, htons(ETH_P_8021Q),
|
||||
old_vid);
|
||||
|
|
|
|||
Loading…
Reference in New Issue