mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rcu: Remove unused macros from rcupdate.h
@ 2023-10-20 17:30 Pedro Falcato
  2023-10-20 19:22 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Pedro Falcato @ 2023-10-20 17:30 UTC (permalink / raw)
  To: Paul E . McKenney, rcu
  Cc: Joel Fernandes, Josh Triplett, Boqun Feng, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, Zqiang, linux-kernel,
	Pedro Falcato

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

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
---
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(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 5e5f920ade9..b9b6b828115 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -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);
-- 
2.42.0


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

* Re: [PATCH] rcu: Remove unused macros from rcupdate.h
  2023-10-20 17:30 [PATCH] rcu: Remove unused macros from rcupdate.h Pedro Falcato
@ 2023-10-20 19:22 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2023-10-20 19:22 UTC (permalink / raw)
  To: Pedro Falcato
  Cc: rcu, Joel Fernandes, Josh Triplett, Boqun Feng, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, Zqiang, linux-kernel

On Fri, Oct 20, 2023 at 06:30:15PM +0100, Pedro Falcato wrote:
> ulong2long, USHORT_CMP_GE and USHORT_CMP_LT are redundant and have been
> unused for quite a few releases.
> 
> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> ---
> 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

>  include/linux/rcupdate.h | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 5e5f920ade9..b9b6b828115 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -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);
> -- 
> 2.42.0
> 

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

end of thread, other threads:[~2023-10-20 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 17:30 [PATCH] rcu: Remove unused macros from rcupdate.h Pedro Falcato
2023-10-20 19:22 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®