netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1 0/2] ethtool: use bits.h defines
@ 2022-12-07 23:17 Jesse Brandeburg
  2022-12-07 23:17 ` [PATCH net-next v1 1/2] ethtool/uapi: use BIT for bit-shifts Jesse Brandeburg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jesse Brandeburg @ 2022-12-07 23:17 UTC (permalink / raw)
  To: davem, kuba, pabeni; +Cc: netdev, mkubecek, Jesse Brandeburg

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.

Jesse Brandeburg (2):
  ethtool/uapi: use BIT for bit-shifts
  ethtool: refactor bit-shifts

 include/linux/ethtool.h              |   2 +-
 include/uapi/linux/ethtool.h         | 112 ++++++++++++++++-----------
 include/uapi/linux/ethtool_netlink.h |   6 +-
 net/ethtool/bitset.c                 |  14 ++--
 net/ethtool/ioctl.c                  |   4 +-
 net/ethtool/strset.c                 |   6 +-
 6 files changed, 84 insertions(+), 60 deletions(-)


base-commit: 01d0e110f2365151d8e69ca4978128112637642d
-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-09 22:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-07 23:17 [PATCH net-next v1 0/2] ethtool: use bits.h defines Jesse Brandeburg
2022-12-07 23:17 ` [PATCH net-next v1 1/2] ethtool/uapi: use BIT for bit-shifts Jesse Brandeburg
2022-12-08  2:41   ` Jakub Kicinski
2022-12-09 22:17     ` Jesse Brandeburg
2022-12-07 23:17 ` [PATCH net-next v1 2/2] ethtool: refactor bit-shifts Jesse Brandeburg
2022-12-08  2:40 ` [PATCH net-next v1 0/2] ethtool: use bits.h defines Jakub Kicinski
2022-12-09 22:18   ` Jesse Brandeburg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).