linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: Muhammad Falak R Wani <falakreyaz@gmail.com>,
	linux-kernel@vger.kernel.org
Cc: Mike Marciniszyn <infinipath@intel.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing.
Date: Fri, 13 May 2016 15:38:34 -0400	[thread overview]
Message-ID: <d039b5f5-4b5e-f916-97d5-3d4f186aeb3c@redhat.com> (raw)
In-Reply-To: <1462106131-9073-1-git-send-email-falakreyaz@gmail.com>

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

On 05/01/2016 08:35 AM, Muhammad Falak R Wani wrote:
> It is safe to use RCU_INIT_POINTER() to NULL a pointer, instead of
> rcu_assign_pointer().
> This results in slightly smaller/faster code.
> 
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> ---
>  drivers/staging/rdma/hfi1/init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c
> index cfcdc16..34e0f90 100644
> --- a/drivers/staging/rdma/hfi1/init.c
> +++ b/drivers/staging/rdma/hfi1/init.c
> @@ -1303,7 +1303,7 @@ static void cleanup_device_data(struct hfi1_devdata *dd)
>  
>  		spin_lock(&ppd->cc_state_lock);
>  		cc_state = get_cc_state(ppd);
> -		rcu_assign_pointer(ppd->cc_state, NULL);
> +		RCU_INIT_POINTER(ppd->cc_state, NULL);
>  		spin_unlock(&ppd->cc_state_lock);
>  
>  		if (cc_state)
> 

Thanks, applied.

-- 
Doug Ledford <dledford@redhat.com>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

      parent reply	other threads:[~2016-05-13 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-01 12:35 [PATCH] staging/rdma/hfi1: use RCU_INIT_POINTER() when NULLing Muhammad Falak R Wani
2016-05-02  5:27 ` Leon Romanovsky
2016-05-13 19:38 ` Doug Ledford [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=d039b5f5-4b5e-f916-97d5-3d4f186aeb3c@redhat.com \
    --to=dledford@redhat.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=falakreyaz@gmail.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=infinipath@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sean.hefty@intel.com \
    /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 NNTP newsgroup(s).