aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2015-02-26 11:12:58 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-03-05 07:00:06 -0500
commitce7ca75176dc3d87c75ea47a7b35a0ac50c7589c (patch)
tree23cf8735fcdeed561939279e6d0b1777b3dbdf67
parent4f651a5b0aa561962c97b76bb67ceb57491efabc (diff)
i40e: use more portable sign extension
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>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
index 4627588f4613..0079ad7bcd0e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
@@ -856,7 +856,7 @@ static void i40e_write_dword(u8 *hmc_bits,
856 if (ce_info->width < 32) 856 if (ce_info->width < 32)
857 mask = ((u32)1 << ce_info->width) - 1; 857 mask = ((u32)1 << ce_info->width) - 1;
858 else 858 else
859 mask = 0xFFFFFFFF; 859 mask = ~(u32)0;
860 860
861 /* don't swizzle the bits until after the mask because the mask bits 861 /* don't swizzle the bits until after the mask because the mask bits
862 * will be in a different bit position on big endian machines 862 * will be in a different bit position on big endian machines
@@ -908,7 +908,7 @@ static void i40e_write_qword(u8 *hmc_bits,
908 if (ce_info->width < 64) 908 if (ce_info->width < 64)
909 mask = ((u64)1 << ce_info->width) - 1; 909 mask = ((u64)1 << ce_info->width) - 1;
910 else 910 else
911 mask = 0xFFFFFFFFFFFFFFFF; 911 mask = ~(u64)0;
912 912
913 /* don't swizzle the bits until after the mask because the mask bits 913 /* don't swizzle the bits until after the mask because the mask bits
914 * will be in a different bit position on big endian machines 914 * will be in a different bit position on big endian machines