All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Saleem, Shiraz" <shiraz.saleem@intel.com>
Cc: Yejune Deng <yejune.deng@gmail.com>,
	"Latif, Faisal" <faisal.latif@intel.com>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] infiniband: i40iw: replace atomic_add_return()
Date: Tue, 1 Dec 2020 12:14:41 -0400	[thread overview]
Message-ID: <20201201161441.GG5487@ziepe.ca> (raw)
In-Reply-To: <b578b692d2ec4f598be584b809aed400@intel.com>

On Tue, Dec 01, 2020 at 02:42:25PM +0000, Saleem, Shiraz wrote:

> >  	case I40IW_CM_STATE_ESTABLISHED:
> >  	case I40IW_CM_STATE_SYN_RCVD:
> > @@ -3020,7 +3020,7 @@ static int i40iw_cm_reject(struct i40iw_cm_node
> > *cm_node, const void *pdata, u8
> >  	i40iw_cleanup_retrans_entry(cm_node);
> > 
> >  	if (!loopback) {
> > -		passive_state = atomic_add_return(1, &cm_node->passive_state);
> > +		passive_state = atomic_inc_return(&cm_node->passive_state);
> 
> Fine with it as its consistent across i40iw. But aren't there many
> more instances of this across the tree?  Isn't this a choice best
> left to the developer?

I don't think it is a style choice, the narrowest applicable atomic
should always be used as a matter of clarity and performance.

Jason

  reply	other threads:[~2020-12-01 16:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30  8:52 [PATCH] infiniband: i40iw: replace atomic_add_return() Yejune Deng
2020-12-01 14:42 ` Saleem, Shiraz
2020-12-01 16:14   ` Jason Gunthorpe [this message]
2020-12-07 19:41 ` Jason Gunthorpe

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=20201201161441.GG5487@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=dledford@redhat.com \
    --cc=faisal.latif@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=shiraz.saleem@intel.com \
    --cc=yejune.deng@gmail.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 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.