Fix several GCC6 warnings
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 of 13 patches 0 repliesNew
2 of 13 patches are in this archive. The cover letter announces 13.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 3/13 | ixgbevf: make use of BIT() macro to avoid shift of signed values | +0 | 0 replies | |
| 13/13 | e1000e: remove unused variable | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Intel-wired-lan] [PATCH v1 00/13] Fix several GCC6 warnings
Quoted 34 lines · Alexander Duyck
Quoted 17 lines · Jacob Keller
This patch series fixes several warnings on Intel(R) drivers, including
for igb, igbvf, e1000e, ixgbe, ixgbevf, i40e, i40evf and fm10k.The primary change is to use
BIT()macro where appropriate, and use the
unsigned postfix for various other bitshifts. While much of this change
doesn't prevent any current warnings, it helps ensure that future additions make use ofBIT()macro or the unsigned postfix and prevent
signed bitshift errors in the future. A few places (especially in ixgbe)
don't use BIT even though it's technically equivalent for style and understanding the real intent of the code.Quoted 3 lines
The series also fixes some other warnings, and makes use of GENMASK in a
few locations.So after looking over a few patches I would say you are bit to eager to apply BIT to things, and there are a few places where GENMASK should be used that you were using bit.
Specifically in the cases where we are shifting a value that just happens to be a 1 by some shift I would recommend not using the BIT macro.??Such cases are the context descriptor index value or the version number for ethtool.??In addition I am not sure it makes much sense to use BIT when we are calculating 2 to the power of a given value.??For example
PAGE_SIZEis defined at (1 <<PAGE_SHIFT), notBIT(PAGE_SHIFT)within the kernel.
Quoted 5 lines
You probably need to apply GENMASK in all the cases where we have BIT(x) - 1 being used.??You will want to set it up as
GENMASK(x - 1, 0).- Alex
Yep. I'll try to clean those up.
Thanks,
Jake