提交 dcb57456 编写于 作者: J Jacob Keller 提交者: Jeff Kirsher

i40e/i40evf: fix I40E_MASK signed shift overflow warnings

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: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 5a6fc256
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "i40e_devids.h" #include "i40e_devids.h"
/* I40E_MASK is a macro used on 32 bit registers */ /* 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_VSI_QP 16
#define I40E_MAX_VF_VSI 3 #define I40E_MAX_VF_VSI 3
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "i40e_devids.h" #include "i40e_devids.h"
/* I40E_MASK is a macro used on 32 bit registers */ /* 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_VSI_QP 16
#define I40E_MAX_VF_VSI 3 #define I40E_MAX_VF_VSI 3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册