Message ID | 20221207231728.2331166-1-jesse.brandeburg@intel.com (mailing list archive) |
---|---|
Headers | show |
Series | ethtool: use bits.h defines | expand |
On Wed, 7 Dec 2022 15:17:26 -0800 Jesse Brandeburg wrote: > Change the ethtool files in the kernel, including uapi header files, to > use the kernel style BIT() and BIT_ULL() functions instead of > open-coding bit shift operations. > > Making this change results in a more consistent presentation of bit- > shift operations as well as reduces the further likelihood of mistaken > (1 << 31) usage which omits the 1UL that is necessary to get an unsigned > result of the shift. Let's hear some opinions but the BIT / GENMASK macros are not universally loved so conversion == cleanup may not obvious.
On 12/7/2022 6:40 PM, Jakub Kicinski wrote: > On Wed, 7 Dec 2022 15:17:26 -0800 Jesse Brandeburg wrote: >> Change the ethtool files in the kernel, including uapi header files, to >> use the kernel style BIT() and BIT_ULL() functions instead of >> open-coding bit shift operations. >> >> Making this change results in a more consistent presentation of bit- >> shift operations as well as reduces the further likelihood of mistaken >> (1 << 31) usage which omits the 1UL that is necessary to get an unsigned >> result of the shift. > > Let's hear some opinions but the BIT / GENMASK macros are not > universally loved so conversion == cleanup may not obvious. Fair enough, I'm open to feedback but haven't seen any so far. I'm planning to wait past the merge window now and submit the next version of this series in a couple of weeks.