@@ -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) {
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(-)