From patchwork Thu Jul 9 14:23:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 6756431 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D8C149F380 for ; Thu, 9 Jul 2015 14:23:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1D67205EE for ; Thu, 9 Jul 2015 14:23:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C162205EB for ; Thu, 9 Jul 2015 14:23:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbbGIOXy (ORCPT ); Thu, 9 Jul 2015 10:23:54 -0400 Received: from mail-by2on0081.outbound.protection.outlook.com ([207.46.100.81]:59006 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750894AbbGIOXw (ORCPT ); Thu, 9 Jul 2015 10:23:52 -0400 Received: from BY1PR0201CA0016.namprd02.prod.outlook.com (10.160.191.154) by SN1PR02MB1375.namprd02.prod.outlook.com (10.162.0.156) with Microsoft SMTP Server (TLS) id 15.1.207.19; Thu, 9 Jul 2015 14:23:51 +0000 Received: from BN1BFFO11FD009.protection.gbl (2a01:111:f400:7c10::1:183) by BY1PR0201CA0016.outlook.office365.com (2a01:111:e400:4814::26) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 14:23:50 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.172) smtp.mailfrom=sandisk.com; qlogic.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.172 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.172; helo=milsmgep11.sandisk.com; Received: from milsmgep11.sandisk.com (63.163.107.172) by BN1BFFO11FD009.mail.protection.outlook.com (10.58.144.72) with Microsoft SMTP Server id 15.1.213.8 via Frontend Transport; Thu, 9 Jul 2015 14:23:48 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep11.sandisk.com (Symantec Messaging Gateway) with SMTP id 6A.BA.04667.3F38E955; Thu, 9 Jul 2015 07:23:47 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.224.2; Thu, 9 Jul 2015 07:23:47 -0700 X-AuditID: ac160a68-f790b6d00000123b-7d-559e83f3494f Received: from [10.50.231.57] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id D7.4D.04661.3F38E955; Thu, 9 Jul 2015 07:23:47 -0700 (PDT) Message-ID: <559E83F2.9030006@sandisk.com> Date: Thu, 9 Jul 2015 07:23:46 -0700 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: James Bottomley CC: Himanshu Madhani , Quinn Tran , Saurav Kashyap , "linux-scsi@vger.kernel.org" Subject: [PATCH v3 04/10] qla2xxx: Replace two macros with an inline function References: <559E8382.6030803@sandisk.com> In-Reply-To: <559E8382.6030803@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKLMWRmVeSWpSXmKPExsWyRoxnke7n5nmhBmumG1q8+PGE1eL/+tss Ft3Xd7BZXLvxltli/sy/rA6sHod//GD2WPflBLvH501yAcxRXDYpqTmZZalF+nYJXBntZ66x FWxQr3h1ILKB8a9CFyMHh4SAicSDM/5djJxAppjEhXvr2boYuTiEBE4wSpyc+ZgdwtnOKPF9 6zwm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3vr7l/f2r1vKpVf7B2tssMsu knx34Jmv/LE7S58ccjsqcmv2x4P1/t49KtfOsnAeMO/wqzrqINdc8L/UfP5kTUnjPZ/irpgd XqA1Myh7U3dZcMWBtAmsm4v+tNv+NXnWUP8+Uq3lkmtAVNJ2JZbijERDLeai4kQAy2b1hwIC AAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD009; 1:7dCz4BWVOgn6C2wGg1G8kEc7g7Xl8mqJTCeNM7MltF+0TeZgpO/BIqGsYdwFJ0SNx8zgnFR3jb+1YtwHQKnde8T8lchAK4Q+Ftyl8Hw/8J6zWGdkb5TNGoEhXyZP+7QfgvxCO2Gp+dxByz5znWplgeukElZgPEmViQmiYbpKamukNshOP529V3VGu0BEuO1Fk3a7Tz8sj2E2mHiR0zF7QIP+Mz3yAjZROLmbMgYrGZ8gYRk887TX4pkjn6A/iAB4CsIPQB+PEBV1ydHFWvK4qc8pZDhHHYiIW/5iMv0Ls4BG03uJkIedi9aAWKJJ+7T8xu+UmgFSQ7Aqyl826PdWDnKq1es4P9Qs6aHhojXicCt6kIocGbTv/HAMfrU4OLN/Cg/wQuRkoLccj1r3WBhfMVY3d0A+FWjftzXfTSL4TIw= X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(92566002)(50466002)(33656002)(5001920100001)(86362001)(83506001)(87266999)(65816999)(87936001)(76176999)(23676002)(65956001)(229853001)(54356999)(50986999)(2950100001)(77096005)(4001350100001)(5001960100002)(189998001)(110136002)(80316001)(77156002)(106466001)(64126003)(62966003)(46102003)(19580395003)(36756003)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1375; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1375; 2:95TRVCPunZUvw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F8absH3n7GGPUeJmMBgKRbLz+XCdRaNnBHQDzmF4OsOC4h7T3KdiHViCp/bfiv/rRtMyRKjO1bquiGSIub+p5w16KMlTveQiefi/7+BXGty2GZsD/A4MC4; 4:WDWy+3YdG9qrDReaqVv54wyaRg+rKt/KTThaNVQ6COCiP7dfgyvheGR+KiG5TLAisGfPeG9CXNYTtbIs9Sw0KTMSFx0T2xKsz0hgpOLJjKbBXCGvklaRywa9nxzriNRWSt2dnQEh64Vru6HyQ30zHiW7IyR27btRhzm5CLZKXOrJWyn9Fj9CsRxxu3uhqzicZWLZ7V1UhyGC+zdsDhuzy/5iPJBgAAvE7myhj39f0TK1iGCSHIHVST7W4BEHj9kjlamDOkY11jFygSwmYbYdZyYxOuGMmVMp/dZMCFdr9zw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SN1PR02MB1375; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1375; X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1375; 23:dsgi9VXr2O3hLyYSZe9jRQVTitRZCQzUZtFU+0N43pTpHp5Kh3Lbc71eGFNntQ5xxdmKfFkXlpoLYkjiXLh1sgEYj4hMOEWnZb/N6/Xhnc71cuJu8+cQ9+8f/i2arxzzcpTXFe9YyE+R7TZQxO2hmCDM6G+9YJOcrlgFtuiAOhua+9I+PdQz9yKXRh4Ptku6j8IK7f9USe5FnrpGpSzOaba6TGtDdn/EIb4W+tYPcvYmT7lKBAJWKOctAQFKvdSVgmNoTHqDNojZ1c8DIB+INngBxy0TfrDIhP0ikysu0T8pD/mPOOLBIGhrJ9fXPkXfAk48hZ2P72VpX8xL4jYb/+zrfX9C1OagzJDXOrE0sybJ8RvwXe4Gf02VIPb3Uylc9gFhZ+s/eweZ93JxULjlnmYhh7QKroFr/78H4ogqIKhDj9hIPmPYDuziSxHu10SghL3EepuHW8c4TvkRBvN+9eUQPgQNFTg6/Ixx7XMJcLQBAHmBW5CbDPI9KoPHnqd2bQdzjbhLguku7vMq2HFx1ty2ppsmjXgvC6yjDTr/H0pj73ZrPmEGlROw3usoBzNwgPRpXaGatd+JYbOYuD4l0t1QNInDWjK+una4aLqMCaMldvg8qU5fwpBb9dptYj4jgH/ZTDiuIenkNbyroyN1a8dl9uPvTo0aDJRt+SGIvmFSZiuyR7XM2dZdP1BmvIm0vBTbekJvOwOsZvRr6tqsXYQTxJToQUzN7LHM68aHylx3RZ50hUEuAFZzhEgXdiTuDbtxav1v4luVuynM0K8thdzZM2/8NlePNGwVda5f33E2jAQRR6iff8bsGfHS2S6dbOMP/H4aHGb2L2XJQKPpHvAjjQPkmApFVleVqhPOTpQRn62zc7I6cCfogKOFhwc2HbHJMEfln/XheV2CfKm8tyMJn/J85wwdcPeJa8/Hn uX6GeVtlwRuiXQmae66/d8r X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1375; 5:7LKbklHk7ZAQNFHQ0euP3yqCML1U96rMEe/KCuNHBumdlskBENaoHQ/gt8UZC2jalr+I6/ND0t0wKPzrBkAMBaPZoiYd3pymEupXqed4YKTd+FAVxLYVdSTUAD8LBpWq0sfFoD+K9KePaWoxUHmmTg==; 24:5FHLRUUqsYNI/YL+MikLZ094L5Olxa3YSn+O8oupAK4veVex2M8jD93aEc/ezA7gSwmw0O/jmAbHL+dSHc/2iUO6T+XsE+4eE5hVVlhBz1g=; 20:wGsPBdBmSZZrvQAH7+rz72FhEn4jGXcPFtyJGBYgBfVkvI1Gn+wadcXE3JtKMl1HvDLazbH4X9pqIOKO0VeOykTaPIvmHhVxBWxW18pF3DcO02XVGKgOm0OqO3ZlJDiEz2cDabFsYVK5E0dejqODGOqEb98ld563cxyz/G2Q+Wk= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 14:23:48.2345 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.172]; Helo=[milsmgep11.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1375 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the QLA82XX_ADDR_IN_RANGE() and QLA8044_ADDR_IN_RANGE() macros with the inline function addr_in_range(). This avoids that the compiler reports the following warning when building with W=1: comparison of unsigned expression >= 0 is always true. Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran Cc: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_nx.c | 21 +++++++++------------ drivers/scsi/qla2xxx/qla_nx2.c | 4 ++-- drivers/scsi/qla2xxx/qla_nx2.h | 6 ++++-- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 5bc40d8..89804d2 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -547,9 +547,6 @@ void qla82xx_idc_unlock(struct qla_hw_data *ha) qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM5_UNLOCK)); } -/* PCI Windowing for DDR regions. */ -#define QLA82XX_ADDR_IN_RANGE(addr, low, high) \ - (((addr) <= (high)) && ((addr) >= (low))) /* * check memory access boundary. * used by test agent. support ddr access only for now @@ -558,9 +555,9 @@ static unsigned long qla82xx_pci_mem_bound_check(struct qla_hw_data *ha, unsigned long long addr, int size) { - if (!QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_DDR_NET, + if (!addr_in_range(addr, QLA82XX_ADDR_DDR_NET, QLA82XX_ADDR_DDR_NET_MAX) || - !QLA82XX_ADDR_IN_RANGE(addr + size - 1, QLA82XX_ADDR_DDR_NET, + !addr_in_range(addr + size - 1, QLA82XX_ADDR_DDR_NET, QLA82XX_ADDR_DDR_NET_MAX) || ((size != 1) && (size != 2) && (size != 4) && (size != 8))) return 0; @@ -577,7 +574,7 @@ qla82xx_pci_set_window(struct qla_hw_data *ha, unsigned long long addr) u32 win_read; scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); - if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_DDR_NET, + if (addr_in_range(addr, QLA82XX_ADDR_DDR_NET, QLA82XX_ADDR_DDR_NET_MAX)) { /* DDR network side */ window = MN_WIN(addr); @@ -592,7 +589,7 @@ qla82xx_pci_set_window(struct qla_hw_data *ha, unsigned long long addr) __func__, window, win_read); } addr = GET_MEM_OFFS_2M(addr) + QLA82XX_PCI_DDR_NET; - } else if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_OCM0, + } else if (addr_in_range(addr, QLA82XX_ADDR_OCM0, QLA82XX_ADDR_OCM0_MAX)) { unsigned int temp1; if ((addr & 0x00ff800) == 0xff800) { @@ -615,7 +612,7 @@ qla82xx_pci_set_window(struct qla_hw_data *ha, unsigned long long addr) } addr = GET_MEM_OFFS_2M(addr) + QLA82XX_PCI_OCM0_2M; - } else if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_QDR_NET, + } else if (addr_in_range(addr, QLA82XX_ADDR_QDR_NET, QLA82XX_P3_ADDR_QDR_NET_MAX)) { /* QDR network side */ window = MS_WIN(addr); @@ -656,16 +653,16 @@ static int qla82xx_pci_is_same_window(struct qla_hw_data *ha, qdr_max = QLA82XX_P3_ADDR_QDR_NET_MAX; /* DDR network side */ - if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_DDR_NET, + if (addr_in_range(addr, QLA82XX_ADDR_DDR_NET, QLA82XX_ADDR_DDR_NET_MAX)) BUG(); - else if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_OCM0, + else if (addr_in_range(addr, QLA82XX_ADDR_OCM0, QLA82XX_ADDR_OCM0_MAX)) return 1; - else if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_OCM1, + else if (addr_in_range(addr, QLA82XX_ADDR_OCM1, QLA82XX_ADDR_OCM1_MAX)) return 1; - else if (QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_QDR_NET, qdr_max)) { + else if (addr_in_range(addr, QLA82XX_ADDR_QDR_NET, qdr_max)) { /* QDR network side */ window = ((addr - QLA82XX_ADDR_QDR_NET) >> 22) & 0x3f; if (ha->qdr_sn_window == window) diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c index 50e36f0..007192d 100644 --- a/drivers/scsi/qla2xxx/qla_nx2.c +++ b/drivers/scsi/qla2xxx/qla_nx2.c @@ -1129,9 +1129,9 @@ qla8044_ms_mem_write_128b(struct scsi_qla_host *vha, } for (i = 0; i < count; i++, addr += 16) { - if (!((QLA8044_ADDR_IN_RANGE(addr, QLA8044_ADDR_QDR_NET, + if (!((addr_in_range(addr, QLA8044_ADDR_QDR_NET, QLA8044_ADDR_QDR_NET_MAX)) || - (QLA8044_ADDR_IN_RANGE(addr, QLA8044_ADDR_DDR_NET, + (addr_in_range(addr, QLA8044_ADDR_DDR_NET, QLA8044_ADDR_DDR_NET_MAX)))) { ret_val = QLA_FUNCTION_FAILED; goto exit_ms_mem_write_unlock; diff --git a/drivers/scsi/qla2xxx/qla_nx2.h b/drivers/scsi/qla2xxx/qla_nx2.h index ada3605..02fe3c4 100644 --- a/drivers/scsi/qla2xxx/qla_nx2.h +++ b/drivers/scsi/qla2xxx/qla_nx2.h @@ -58,8 +58,10 @@ #define QLA8044_PCI_QDR_NET_MAX ((unsigned long)0x043fffff) /* PCI Windowing for DDR regions. */ -#define QLA8044_ADDR_IN_RANGE(addr, low, high) \ - (((addr) <= (high)) && ((addr) >= (low))) +static inline bool addr_in_range(u64 addr, u64 low, u64 high) +{ + return addr <= high && addr >= low; +} /* Indirectly Mapped Registers */ #define QLA8044_FLASH_SPI_STATUS 0x2808E010