netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] netlink: Use the BITS_PER_LONG macro
@ 2024-09-02 11:10 Jinjie Ruan
  2024-09-03  1:39 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Jinjie Ruan @ 2024-09-02 11:10 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, christophe.jaillet, horms, netdev
  Cc: ruanjinjie

sizeof(unsigned long) * 8 is the number of bits in an unsigned long
variable, replace it with BITS_PER_LONG macro to make it simpler.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 net/netlink/af_netlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h
index 5b0e4e62ab8b..e369980e30e3 100644
--- a/net/netlink/af_netlink.h
+++ b/net/netlink/af_netlink.h
@@ -19,7 +19,7 @@ enum {
 	NETLINK_F_STRICT_CHK,
 };
 
-#define NLGRPSZ(x)	(ALIGN(x, sizeof(unsigned long) * 8) / 8)
+#define NLGRPSZ(x)	(ALIGN(x, BITS_PER_LONG) / 8)
 #define NLGRPLONGS(x)	(NLGRPSZ(x)/sizeof(unsigned long))
 
 struct netlink_sock {
-- 
2.34.1


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

end of thread, other threads:[~2024-09-03 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 11:10 [PATCH -next] netlink: Use the BITS_PER_LONG macro Jinjie Ruan
2024-09-03  1:39 ` Jakub Kicinski
2024-09-03  2:06   ` Jinjie Ruan
2024-09-03 16:12     ` Jakub Kicinski

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).