From: Yejune Deng <yejune.deng@gmail.com>
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
yejune.deng@gmail.com
Subject: [PATCH] scsi: pmcraid: replace atomic_add_return()
Date: Mon, 16 Nov 2020 15:50:16 +0800 [thread overview]
Message-ID: <1605513016-7357-1-git-send-email-yejune.deng@gmail.com> (raw)
atomic_inc_return() looks better
Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
drivers/scsi/pmcraid.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index cbe5fab..3e5b70c 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3381,7 +3381,7 @@ static int pmcraid_queuecommand_lck(
* block of scsi_cmd which is re-used (e.g. cancel/abort), which uses
* hrrq_id assigned here in queuecommand
*/
- ioarcb->hrrq_id = atomic_add_return(1, &(pinstance->last_message_id)) %
+ ioarcb->hrrq_id = atomic_inc_return(&pinstance->last_message_id) %
pinstance->num_hrrq;
cmd->cmd_done = pmcraid_io_done;
@@ -3684,7 +3684,7 @@ static long pmcraid_ioctl_passthrough(
* block of scsi_cmd which is re-used (e.g. cancel/abort), which uses
* hrrq_id assigned here in queuecommand
*/
- ioarcb->hrrq_id = atomic_add_return(1, &(pinstance->last_message_id)) %
+ ioarcb->hrrq_id = atomic_inc_return(&pinstance->last_message_id) %
pinstance->num_hrrq;
if (request_size) {
--
1.9.1
reply other threads:[~2020-11-16 7:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1605513016-7357-1-git-send-email-yejune.deng@gmail.com \
--to=yejune.deng@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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
Powered by JetHome