i40e/i40evf: fix I40E_MASK signed shift overflow warnings
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 13 Apr 2016 23:08:25 +0000 (16:08 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 2 May 2016 00:05:08 +0000 (17:05 -0700)
GCC 6 has a new warning which will display when you attempt to left
shift a signed value beyond the storage size of the type. I40E_MASK
generates a mask value for 32bit registers. Properly typecast the mask
value and place the values in parenthesis to prevent macro expansion
issues.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_type.h
drivers/net/ethernet/intel/i40evf/i40e_type.h

index 8aa14aacdd353171fea6954e26d5ea939e4ffff3..bd5f13bef83c794bb03435308b282831b9300c95 100644 (file)
@@ -36,7 +36,7 @@
 #include "i40e_devids.h"
 
 /* I40E_MASK is a macro used on 32 bit registers */
-#define I40E_MASK(mask, shift) (mask << shift)
+#define I40E_MASK(mask, shift) ((u32)(mask) << (shift))
 
 #define I40E_MAX_VSI_QP                        16
 #define I40E_MAX_VF_VSI                        3
index bfc97c2f22bbdfb216831c057ad8bab0e0817076..97f96e0d9c4c4000cc8d003129f09c1fb93f3219 100644 (file)
@@ -36,7 +36,7 @@
 #include "i40e_devids.h"
 
 /* I40E_MASK is a macro used on 32 bit registers */
-#define I40E_MASK(mask, shift) (mask << shift)
+#define I40E_MASK(mask, shift) ((u32)(mask) << (shift))
 
 #define I40E_MAX_VSI_QP                        16
 #define I40E_MAX_VF_VSI                        3
This page took 0.030408 seconds and 5 git commands to generate.