mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luo Jiaxing <luojiaxing@huawei.com>
To: <kashyap.desai@broadcom.com>, <sumit.saxena@broadcom.com>,
	<shivasharan.srikanteshwara@broadcom.com>, <jejb@linux.ibm.com>,
	<martin.petersen@oracle.com>
Cc: <megaraidlinux.pdl@broadcom.com>, <linux-scsi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
	<luojiaxing@huawei.com>
Subject: [PATCH v1 2/8] scsi: megaraid_sas: use parentheses to enclose macros with complex values
Date: Sat, 10 Apr 2021 14:48:01 +0800	[thread overview]
Message-ID: <1618037287-460-3-git-send-email-luojiaxing@huawei.com> (raw)
In-Reply-To: <1618037287-460-1-git-send-email-luojiaxing@huawei.com>

checkpatch.pl report several error below:

ERROR: Macros with complex values should be enclosed in parentheses
+#define SCP2LUN(scp)                   (u32)(scp)->device->lun // to LUN

ERROR: Macros with complex values should be enclosed in parentheses
+#define SCP2ADAPTER(scp)       (adapter_t *)SCSIHOST2ADAP(SCP2HOST(scp))

So fix those by enclosed by parentheses.

Signed-off-by: Jianqin Xie <xiejianqin@hisilicon.com>
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
---
 drivers/scsi/megaraid/mbox_defs.h    |  2 +-
 drivers/scsi/megaraid/mega_common.h  | 16 ++++++++--------
 drivers/scsi/megaraid/megaraid_sas.h |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/megaraid/mbox_defs.h b/drivers/scsi/megaraid/mbox_defs.h
index 5001624..3efbfdb 100644
--- a/drivers/scsi/megaraid/mbox_defs.h
+++ b/drivers/scsi/megaraid/mbox_defs.h
@@ -124,7 +124,7 @@
 #define FC_MAX_PHYSICAL_DEVICES		256
 #define MAX_MBOX_CHANNELS		5
 #define MAX_MBOX_TARGET			15
-#define MBOX_MAX_PHYSICAL_DRIVES	MAX_MBOX_CHANNELS*MAX_MBOX_TARGET
+#define MBOX_MAX_PHYSICAL_DRIVES	(MAX_MBOX_CHANNELS * MAX_MBOX_TARGET)
 #define MAX_ROW_SIZE_40LD		32
 #define MAX_ROW_SIZE_8LD		8
 #define SPAN_DEPTH_8_SPANS		8
diff --git a/drivers/scsi/megaraid/mega_common.h b/drivers/scsi/megaraid/mega_common.h
index 2ad0aa2..2a0981b 100644
--- a/drivers/scsi/megaraid/mega_common.h
+++ b/drivers/scsi/megaraid/mega_common.h
@@ -196,22 +196,22 @@ typedef struct {
 
 
 // conversion from scsi command
-#define SCP2HOST(scp)			(scp)->device->host	// to host
-#define SCP2HOSTDATA(scp)		SCP2HOST(scp)->hostdata	// to soft state
-#define SCP2CHANNEL(scp)		(scp)->device->channel	// to channel
-#define SCP2TARGET(scp)			(scp)->device->id	// to target
-#define SCP2LUN(scp)			(u32)(scp)->device->lun	// to LUN
+#define SCP2HOST(scp)			((scp)->device->host)	// to host
+#define SCP2HOSTDATA(scp)		(SCP2HOST(scp)->hostdata)	// to soft state
+#define SCP2CHANNEL(scp)		((scp)->device->channel)	// to channel
+#define SCP2TARGET(scp)			((scp)->device->id)	// to target
+#define SCP2LUN(scp)			((u32)(scp)->device->lun)	// to LUN
 
 // generic macro to convert scsi command and host to controller's soft state
 #define SCSIHOST2ADAP(host)	(((caddr_t *)(host->hostdata))[0])
-#define SCP2ADAPTER(scp)	(adapter_t *)SCSIHOST2ADAP(SCP2HOST(scp))
+#define SCP2ADAPTER(scp)	((adapter_t *)SCSIHOST2ADAP(SCP2HOST(scp)))
 
 
 #define MRAID_IS_LOGICAL(adp, scp)	\
-	(SCP2CHANNEL(scp) == (adp)->max_channel) ? 1 : 0
+	((SCP2CHANNEL(scp) == (adp)->max_channel) ? 1 : 0)
 
 #define MRAID_IS_LOGICAL_SDEV(adp, sdev)	\
-	(sdev->channel == (adp)->max_channel) ? 1 : 0
+	((sdev->channel == (adp)->max_channel) ? 1 : 0)
 
 /**
  * MRAID_GET_DEVICE_MAP - device ids
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index b5a765b..b652a84 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -154,9 +154,9 @@
 #define MFI_INIT_CLEAR_HANDSHAKE		0x00000008
 #define MFI_INIT_HOTPLUG			0x00000010
 #define MFI_STOP_ADP				0x00000020
-#define MFI_RESET_FLAGS				MFI_INIT_READY| \
-						MFI_INIT_MFIMODE| \
-						MFI_INIT_ABORT
+#define MFI_RESET_FLAGS				(MFI_INIT_READY | \
+						MFI_INIT_MFIMODE | \
+						MFI_INIT_ABORT)
 #define MFI_ADP_TRIGGER_SNAP_DUMP		0x00000100
 #define MPI2_IOCINIT_MSGFLAG_RDPQ_ARRAY_MODE    (0x01)
 
-- 
2.7.4


  parent reply	other threads:[~2021-04-10  6:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  6:47 [PATCH v1 0/8] scsi: megaraid: some misc clean up patches Luo Jiaxing
2021-04-10  6:48 ` [PATCH v1 1/8] scsi: megaraid: clean up for white space Luo Jiaxing
2021-04-10  6:48 ` Luo Jiaxing [this message]
2021-04-10  6:48 ` [PATCH v1 3/8] scsi: megaraid: clean up for blank lines Luo Jiaxing
2021-04-10  6:48 ` [PATCH v1 4/8] scsi: megaraid: clean up for open/close brace Luo Jiaxing
2021-04-10  6:48 ` [PATCH v1 5/8] scsi: megaraid: clean up for "foo * bar" Luo Jiaxing
2021-04-10  6:48 ` [PATCH v1 6/8] scsi: megaraid: clean up for code indent Luo Jiaxing
2021-04-10  6:48 ` [PATCH v1 7/8] scsi: megaraid: clean up for trailing statements Luo Jiaxing
2021-04-10  6:48 ` [PATCH v1 8/8] scsi: megaraid: clean up for static variable initialise to 0 Luo Jiaxing

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=1618037287-460-3-git-send-email-luojiaxing@huawei.com \
    --to=luojiaxing@huawei.com \
    --cc=jejb@linux.ibm.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=megaraidlinux.pdl@broadcom.com \
    --cc=shivasharan.srikanteshwara@broadcom.com \
    --cc=sumit.saxena@broadcom.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

all inboxes | Powered by JetHome®