Skip to contentSkip to conversation

vdso/bits.h: Add BIT_ULL() for the sake of consistency

PATCH Applied Andy Shevchenko 2 participants 3 messages Nov 28, 2022 – Jan 31, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vdso/bits.h: Add BIT_ULL() for the sake of consistency

While the minimization is a good thing, the split added some inconsistency since BIT() and BIT_ULL() defined in the different files and confuses unprepared reader. Let's move BIT_ULL() to vdso/bits.h, so they will go together (as UL(), ULL() and so on).

---
 include/linux/bits.h | 1 -
 include/vdso/bits.h  | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
include/linux/bits.h +0 -1
index 87d112650dfb..7c0cf5031abe 100644
@@ -6,7 +6,6 @@
 #include <vdso/bits.h>
 #include <asm/bitsperlong.h>
 
-#define BIT_ULL(nr)		(ULL(1) << (nr))
 #define BIT_MASK(nr)		(UL(1) << ((nr) % BITS_PER_LONG))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
 #define BIT_ULL_MASK(nr)	(ULL(1) << ((nr) % BITS_PER_LONG_LONG))
include/vdso/bits.h +1 -0
index 6d005a1f5d94..388b212088ea 100644
@@ -5,5 +5,6 @@
 #include <vdso/const.h>
 
 #define BIT(nr)			(UL(1) << (nr))
+#define BIT_ULL(nr)		(ULL(1) << (nr))
 
 #endif	/* __VDSO_BITS_H */
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Andy Shevchenko

While the minimization is a good thing, the split added some inconsistency since BIT() and BIT_ULL() defined in the different files and confuses unprepared reader. Let's move BIT_ULL() to vdso/bits.h, so they will go together (as UL(), ULL() and so on).

Any comments on this?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to Andy Shevchenko
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     cbdb1f163af2bb90d01be1f0263df1d8d5c9d9d3
Gitweb:        https://git.kernel.org/tip/cbdb1f163af2bb90d01be1f0263df1d8d5c9d9d3
Author:        Andy Shevchenko <[email protected]>
AuthorDate:    Mon, 28 Nov 2022 16:10:03 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 31 Jan 2023 14:42:10 +01:00

vdso/bits.h: Add BIT_ULL() for the sake of consistency

The minimization done in 3945ff37d2f4 ("linux/bits.h: Extract common header for vDSO") was required to isolate the VDSO build from the larger kernel header impact.

The split added some inconsistency since BIT() and BIT_ULL() are now defined in the different files which confuses unprepared reader.

Move BIT_ULL() to vdso/bits.h. No functional change.

---
 include/linux/bits.h | 1 -
 include/vdso/bits.h  | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
include/linux/bits.h +0 -1
index 87d1126..7c0cf50 100644
@@ -6,7 +6,6 @@
 #include <vdso/bits.h>
 #include <asm/bitsperlong.h>
 
-#define BIT_ULL(nr)		(ULL(1) << (nr))
 #define BIT_MASK(nr)		(UL(1) << ((nr) % BITS_PER_LONG))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
 #define BIT_ULL_MASK(nr)	(ULL(1) << ((nr) % BITS_PER_LONG_LONG))
include/vdso/bits.h +1 -0
index 6d005a1..388b212 100644
@@ -5,5 +5,6 @@
 #include <vdso/const.h>
 
 #define BIT(nr)			(UL(1) << (nr))
+#define BIT_ULL(nr)		(ULL(1) << (nr))
 
 #endif	/* __VDSO_BITS_H */