All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Antonio Quartulli <a@unstable.cc>
Subject: Re: [PATCH] batman-adv: use rcu_replace_pointer() where appropriate
Date: Fri, 22 May 2020 14:26:39 +0200	[thread overview]
Message-ID: <10146887.DO00CSXobA@sven-edge> (raw)
In-Reply-To: <20200520084140.18624-1-a@unstable.cc>

[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]

On Wednesday, 20 May 2020 10:41:40 CEST Antonio Quartulli wrote:
> In a63fc6b7 ("rcu: Upgrade rcu_swap_protected() to rcu_replace_pointer()")
> a new helper macro named rcu_replace_pointer() was introduced to
> simplify code requiring to switch an rcu pointer to a new value while
> extracting the old one.

Please use the reference style 'commit a63fc6b75cca ("rcu: Upgrade 
rcu_swap_protected() to rcu_replace_pointer()")' in the future [1]. checkpatch 
will also report something like this when it detects a short commit id:

    ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit a63fc6b75cca ("rcu: Upgrade rcu_swap_protected() to rcu_replace_pointer()")'

I will change this for you.

[...]
> +#if LINUX_VERSION_IS_LESS(5, 5, 0)
> +
> +#define rcu_replace_pointer(rcu_ptr, ptr, c)				\
> +({									\
> +	typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c));	\
> +	rcu_assign_pointer((rcu_ptr), (ptr));				\
> +	__tmp;								\
> +})
> +
> +#endif /* LINUX_VERSION_IS_LESS(5, 5, 0) */

To avoid problems with a (potentially) backported patch in the stable
kernels - please #undef rcu_replace_pointer first. I will do this for you.

Applied.

Thanks,
	Sven

[1] https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html#describe-your-changes

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2020-05-22 12:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  8:41 [PATCH] batman-adv: use rcu_replace_pointer() where appropriate Antonio Quartulli
2020-05-22 12:26 ` Sven Eckelmann [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=10146887.DO00CSXobA@sven-edge \
    --to=sven@narfation.org \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.