RCU Archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Pedro Falcato <pedro.falcato@gmail.com>
Cc: rcu@vger.kernel.org, Joel Fernandes <joel@joelfernandes.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang1211@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu: Remove unused macros from rcupdate.h
Date: Fri, 20 Oct 2023 12:22:08 -0700	[thread overview]
Message-ID: <b2a15247-fbe6-47bd-9857-5d5163834dfc@paulmck-laptop> (raw)
In-Reply-To: <20231020173015.30509-1-pedro.falcato@gmail.com>

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
> 

      reply	other threads:[~2023-10-20 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 17:30 [PATCH] rcu: Remove unused macros from rcupdate.h Pedro Falcato
2023-10-20 19:22 ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2a15247-fbe6-47bd-9857-5d5163834dfc@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=pedro.falcato@gmail.com \
    --cc=qiang.zhang1211@gmail.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).