Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2912679pxb; Sun, 15 Nov 2020 23:53:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwI/jAx8riG1mqs3Vy51BsNc1e/GeWIXX8ekiECnULzkbLzu9Lb6nLtGtxLZop4fmjQL5FF X-Received: by 2002:a17:906:934d:: with SMTP id p13mr12932416ejw.245.1605513202936; Sun, 15 Nov 2020 23:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605513202; cv=none; d=google.com; s=arc-20160816; b=Iln4ERzI0J6wNA/Ka7vg+OHXUFgxpyL6y+rNfRJ/PIT/d97ULHCUDGLlhHY0Ooh/yX XppT1K2gFdq1vIesIx1ILblbLuZN2zDMDCau128BueM3Z0RORzRn9ZOaaY2jvKMyO5w0 FruX9M1CoxexmQO9fjq2Zb+kC8RPfEkLukKhDAwMorRIbungO7vCYiE1Uz2njiobuOPF 2vh0urJdkKEsb+4C4pMdeVcveG7KMYggyItp4g3FXlFx9U0voOfwfJvL02NIHZ6cPQbz yLEEPSH3kughqP4qnP1jMt5BUwKBvvAa+2JSGoBSqz8v4PyG1kigQS5RAoifIHlQMtBG 1j6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=fXZ0Y2LRL/rfunqIOF6yRFDaxDl0MTFKNEqvS2WDbvo=; b=ULHR8YOwA/xq/q0QtTxmvfRZWTAH1sxCOsYIl8u43BvQpVdPPpRW64/maFWCuXCC48 Qga3h8WSUU/LQwZdHOaZXlFbYDJglpuGlyKjmDl9uvMhtIIApL2iSOleOHFegbDGbhCx 0Ji2xfP0FMEPS3cHDpG0j2efEl4/jUkBFiGDZGZ2VBtLGzYuS2wAH/GE50znqbB9R/2x r+cRAenu1yG3zyqEYgeKJcajvN+fIuVkJTdhFmgqNFF2MAp/m/fA4qNK6COnbYj/dC3E NJEzfMvrkGYgntCOWh3oLVTchiKpjFBK95BlDlCRHDYW8kR2+48zhc9XXbMWqS8e/KsH vlDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rDukm1bp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si7296836eju.683.2020.11.15.23.52.59; Sun, 15 Nov 2020 23:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rDukm1bp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727916AbgKPHuh (ORCPT + 99 others); Mon, 16 Nov 2020 02:50:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726524AbgKPHug (ORCPT ); Mon, 16 Nov 2020 02:50:36 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2527C0613CF; Sun, 15 Nov 2020 23:50:36 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id 81so4092325pgf.0; Sun, 15 Nov 2020 23:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fXZ0Y2LRL/rfunqIOF6yRFDaxDl0MTFKNEqvS2WDbvo=; b=rDukm1bpLxDGwB7pdXYCH/9tvNIIqF6PVBO3sgQqkkxkQVM565qCzrOrw/IMepl64G hw0CZqr6EcBMqY2k0ZLcNmQvy8A631Bl0RjSLt/IJlK6V9lgiHl8py5zb72BUSK/Dpnx RIXYkHYcYnXp9NbRRpLJjigu0DQKxCMCdjSWsgwic7I/g+xCn6Y0RaOny/0k9prB3a+/ uyZlrBE+/aTKlzKe6an2QPMgnDqFKXJX8E1RuDh9pHmYDFlXHt/w26IF0d7swZoBxMPn NVKNkJO/+a4znFr7MG9Se0Y5LoChlC6dQLxhaJegOrsmo96zQdQDYPrGAtJCAshM50XL qONw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fXZ0Y2LRL/rfunqIOF6yRFDaxDl0MTFKNEqvS2WDbvo=; b=EDxuQZyyFeLMdY/odIWr5OVfThd6sB9khKKrwB0Bw9tLAUR3YOezkNuq5yC3xp9d8z CaRRt7tOo2PkYSa3Tr7BIlPMRUjXt1ct0dd9g78rUkzHnOuIUEgGqBZ6tbppJhDLXE04 bbi+O+wwoBy+uMwTxMaPkHg8zteWi9t7w+v7j/XTTO6tT7BpMxybd4lIkDt7nmwcKF7c UadfMXdrZBmXQfu5mWOkOXLY8kvXi7pj5uNeHdAhdetaI8F+03dcPnH/duJCgKG1DH7b ZR6E+3iThYVJGm3SKgYMNy3fnue85aJaE4tq5Jn7W6DWLS6jACqPIUXpraC/AB7aXy2p FcMg== X-Gm-Message-State: AOAM531ZLEoqW0W9tCH3UbuhEIkqge+3b0OMHaC9bTCD71w9Plkez6gh K+3huKnQP2ayeUBggyc2hNU= X-Received: by 2002:a17:90a:8543:: with SMTP id a3mr14947266pjw.13.1605513036454; Sun, 15 Nov 2020 23:50:36 -0800 (PST) Received: from localhost.localdomain ([8.210.202.142]) by smtp.gmail.com with ESMTPSA id d10sm16776574pjj.38.2020.11.15.23.50.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Nov 2020 23:50:36 -0800 (PST) From: Yejune Deng 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 Message-Id: <1605513016-7357-1-git-send-email-yejune.deng@gmail.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org atomic_inc_return() looks better Signed-off-by: Yejune Deng --- 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