Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp204774pxb; Fri, 9 Apr 2021 23:51:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6jKlJEiwyvg1hh/G6HcRavZzC0XHBemBsJDJq9WX1agX0/TDqCKxOvw0lpK1dFdC66M/Z X-Received: by 2002:a17:90a:6be2:: with SMTP id w89mr386986pjj.130.1618037460331; Fri, 09 Apr 2021 23:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618037460; cv=none; d=google.com; s=arc-20160816; b=wKwtXrGUiS6wOt+dITsVRt4WqLbObBp8XDs42RDvHkYVEMZDBgwisQNfYQQAku/EOi fKeMrda532FHXJpUPL74KWJ6YTfFWug2c4C/wwhnQWpTQ6eq++5OEXn68hNVKwkL7dLJ v9I2XPHs7FaXtWtvqHVkjnGsvVTfc8zVJydUGklbP7G9LpIS2Unj8zoy18kdqzTpAXIy zCDDLSgxZrYHu7cmD1SMNwHQ73U+D+qNn51T3GMi9xnHdz7qEFNLt7kQbauaOsw/kB+G GIS3xeJSDy03lWqDafTxO3QuLVBMqqOcUhjqSGsRlfD+fp9yDvggf5FHW3A5mbl3sYL7 VkeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=A5YSVNQSTnfjokneqWbT9p/a2Jj0PCnsNHE9t7C3VY4=; b=Zy8ec/KaP4MLGyBjs8wf0DEkDiTsqexBbggBXkDtkj+5/lLR/HJvmcE8ORgr/jTygy G+AxF2swslnxa3X9vMYe/GV+Gmv3VdtT9+2pN10D8+E9aPN5rQNx5bHIlkWCMkF664FS RLB09AMEdjyD3YVKqEADezo6sH+v/A301snu4MPvi5iuGoe9EpTy9sps68WWXknSkIo/ vjeKkAcVESfXtNg86y3zxnofSMUFm7RSZWsha0nex6n71VWh2FngbzowHexWQ91Pilax 9SZFOjIUH/lfMQzp6ipBCXDtEQz9aFwRuzs3HVgcUfhd6wUSfExjOUIDIpSg/y5hid0d Ju8w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si5264013pgg.244.2021.04.09.23.50.47; Fri, 09 Apr 2021 23:51:00 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234192AbhDJGsd (ORCPT + 99 others); Sat, 10 Apr 2021 02:48:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16890 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234364AbhDJGsL (ORCPT ); Sat, 10 Apr 2021 02:48:11 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FHQWJ6Fl2zkhsT; Sat, 10 Apr 2021 14:46:04 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 10 Apr 2021 14:47:44 +0800 From: Luo Jiaxing To: , , , , CC: , , , , 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 Message-ID: <1618037287-460-3-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> References: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Luo Jiaxing --- 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