Skip to content

Commit

Permalink
i40e: use more portable sign extension
Browse files Browse the repository at this point in the history
Use automatic sign extension by replacing 0xffff... constants
with ~(u64)0 or ~(u32)0.

Change-ID: I73cab4cd2611795bb12e00f0f24fafaaee07457c
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Jesse Brandeburg authored and Jeff Kirsher committed Mar 5, 2015
1 parent 4f651a5 commit ce7ca75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ static void i40e_write_dword(u8 *hmc_bits,
if (ce_info->width < 32)
mask = ((u32)1 << ce_info->width) - 1;
else
mask = 0xFFFFFFFF;
mask = ~(u32)0;

/* don't swizzle the bits until after the mask because the mask bits
* will be in a different bit position on big endian machines
Expand Down Expand Up @@ -908,7 +908,7 @@ static void i40e_write_qword(u8 *hmc_bits,
if (ce_info->width < 64)
mask = ((u64)1 << ce_info->width) - 1;
else
mask = 0xFFFFFFFFFFFFFFFF;
mask = ~(u64)0;

/* don't swizzle the bits until after the mask because the mask bits
* will be in a different bit position on big endian machines
Expand Down

0 comments on commit ce7ca75

Please sign in to comment.