Skip to contentSkip to conversation

rcu: Remove unused macros from rcupdate.h

PATCH Applied Pedro Falcato 2 participants 2 messages Oct 20, 2023 RCU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: Remove unused macros from rcupdate.h

ulong2long, USHORT_CMP_GE and USHORT_CMP_LT are redundant and have been unused for quite a few releases.

---
Just a boring chore patch that cleans up a few unused macros.

I'm *very* interested in knowing how that ulong2long macro came along, though. What was wrong with '(long) a'?

 include/linux/rcupdate.h | 3 ---
 1 file changed, 3 deletions(-)
include/linux/rcupdate.h +0 -3
index 5e5f920ade9..b9b6b828115 100644
@@ -34,9 +34,6 @@
 
 #define ULONG_CMP_GE(a, b)	(ULONG_MAX / 2 >= (a) - (b))
 #define ULONG_CMP_LT(a, b)	(ULONG_MAX / 2 < (a) - (b))
-#define ulong2long(a)		(*(long *)(&(a)))
-#define USHORT_CMP_GE(a, b)	(USHRT_MAX / 2 >= (unsigned short)((a) - (b)))
-#define USHORT_CMP_LT(a, b)	(USHRT_MAX / 2 < (unsigned short)((a) - (b)))
 
 /* Exported common interfaces */
 void call_rcu(struct rcu_head *head, rcu_callback_t func);
Signature · 1 line
2.42.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Pedro Falcato

ulong2long, USHORT_CMP_GE and USHORT_CMP_LT are redundant and have been unused for quite a few releases.

---
Just a boring chore patch that cleans up a few unused macros.

I'm *very* interested in knowing how that ulong2long macro came along, though. What was wrong with '(long) a'?

Signed integer overflow, if I remember correctly. But the Linux-kernel build process forced signed integer overflow to be defined.

Queued for v6.8, thank you!

Thanx, Paul

Quoted 20 lines
 include/linux/rcupdate.h | 3 ---
 1 file changed, 3 deletions(-)
include/linux/rcupdate.h +0 -3
index 5e5f920ade9..b9b6b828115 100644
@@ -34,9 +34,6 @@
 
 #define ULONG_CMP_GE(a, b)	(ULONG_MAX / 2 >= (a) - (b))
 #define ULONG_CMP_LT(a, b)	(ULONG_MAX / 2 < (a) - (b))
-#define ulong2long(a)		(*(long *)(&(a)))
-#define USHORT_CMP_GE(a, b)	(USHRT_MAX / 2 >= (unsigned short)((a) - (b)))
-#define USHORT_CMP_LT(a, b)	(USHRT_MAX / 2 < (unsigned short)((a) - (b)))
 
 /* Exported common interfaces */
 void call_rcu(struct rcu_head *head, rcu_callback_t func);
Signature · 1 line
2.42.0