Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751991AbdF3Xyy (ORCPT ); Fri, 30 Jun 2017 19:54:54 -0400 Received: from mail-bl2nam02on0054.outbound.protection.outlook.com ([104.47.38.54]:41991 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751581AbdF3Xyw (ORCPT ); Fri, 30 Jun 2017 19:54:52 -0400 From: "Madhani, Himanshu" To: Arnd Bergmann CC: Dept-Eng QLA2xxx Upstream , "James E.J. Bottomley" , "Martin K. Petersen" , "Tran, Quinn" , Nicholas Bellinger , "Trapp, Darren" , Anil Gurumurthy , "Grigsby, Duane" , Linux SCSI Mailinglist , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] scsi: qla2xxx: avoid unused-function warning Thread-Topic: [PATCH 2/2] scsi: qla2xxx: avoid unused-function warning Thread-Index: AQHS8buGaC370xxAtEG2I0+IdR3FvaI+FQqA Date: Fri, 30 Jun 2017 23:54:48 +0000 Message-ID: References: <20170630161056.30630-1-arnd@arndb.de> <20170630161056.30630-2-arnd@arndb.de> In-Reply-To: <20170630161056.30630-2-arnd@arndb.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=cavium.com; x-originating-ip: [173.186.134.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR07MB3599;7:8JQIRcym30Ze4Z5xNiF0gh/6FEQ3KKQuvRhuujXQA5PBtaT0lJLJP0ID8axyzwlrhhSBeqmmYVb4MG6dyMq6DTlqwOC5iqx6zA2+3Y3J+byXOidlxl7OGz9fsM1bumFaZUa7OLRv7NT8TDoe1+xAhMsyMyMUQJgloLsNf8v6R3SqaCqD4AYmKEIjSJi5z52goYsXyVGk2jWW4WXhgqj/GwpoJfWcRaItvo+vD9QewxES2t9Cu3SlFEiKXTtM8/5CUPaEETwoMGGb+vzwci2dPzyOJPbYWXy2ObhEtIcECs+h4RE01BihTbld8Ds+Q7uItTMB72p0EK0J4x5iKjU4cqP+mX0Lxi/CiueX/S4y4rh43qZHGwVQlI//3n1Iac9jztxMB3kZbm3Xqep6sCh/sshc29CgtzvDGOWbGLuSb/aZ3nRG/DtvBfT0lqEeuJY+kx4MFLofBXMatupcHV8Oqmxa1hw1sJQfNcACzH35ep+tyVSr4reyyRBhPkGtcnvyDman4X7Ma4TD3NJAue9Giv6a4hA72MEdR+NV7enLuJodz3SqMkwzbU72rngSH0ggTMTuf1xjJ7mlqDBQcVO7QK9pV4vjq6+UEq19mm6Jpppkpuy0jfMNsfIE2LGhWHrEVzIkksM8TKG67QuGCUVH9Lh4VQmvB3C9Jf663fg9/Kp1I0QCkdYUlbnTd+344azjJpvD/LQRiBvb7B425m8LB0CO0BXeAu36DE0NE37Rw5mwuINoKZ+iH8/3RRYDiTmlKWwviYfyOhCMAM7pvHn+PG3x7kOUcF3XlhRJvDCNdpE= x-ms-office365-filtering-correlation-id: 11b4096d-888e-4258-2c2f-08d4c013641e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR07MB3599; x-ms-traffictypediagnostic: MWHPR07MB3599: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(133145235818549)(236129657087228); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123555025)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR07MB3599;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR07MB3599; x-forefront-prvs: 0354B4BED2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39410400002)(39840400002)(39450400003)(39400400002)(24454002)(377454003)(6246003)(53936002)(110136004)(38730400002)(2950100002)(6916009)(189998001)(50986999)(76176999)(25786009)(54356999)(6486002)(77096006)(4326008)(66066001)(33656002)(3280700002)(99286003)(2900100001)(6512007)(36756003)(6436002)(54906002)(305945005)(8936002)(83716003)(3660700001)(6506006)(53546010)(86362001)(6116002)(14454004)(7736002)(72206003)(81166006)(5660300001)(102836003)(478600001)(82746002)(8676002)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB3599;H:MWHPR07MB3455.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <4CEC7B51BFE4E14F896644E835D72C0D@namprd07.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jun 2017 23:54:48.0341 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3599 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5UNtJ5G021022 Content-Length: 4024 Lines: 131 > On Jun 30, 2017, at 9:10 AM, Arnd Bergmann wrote: > > When NVMe support is disabled, we get a couple of harmless warnings: > > drivers/scsi/qla2xxx/qla_nvme.c:667:13: error: 'qla_nvme_unregister_remote_port' defined but not used [-Werror=unused-function] > drivers/scsi/qla2xxx/qla_nvme.c:634:13: error: 'qla_nvme_abort_all' defined but not used [-Werror=unused-function] > drivers/scsi/qla2xxx/qla_nvme.c:604:12: error: 'qla_nvme_wait_on_rport_del' defined but not used [-Werror=unused-function] > > This replaces the preprocessor checks in the code with equivalent > compiler conditionals, which lets gcc drop the unused functions > without warning, and is nicer to read. > > Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration") > Signed-off-by: Arnd Bergmann > --- > drivers/scsi/qla2xxx/Kconfig | 1 + > drivers/scsi/qla2xxx/qla_nvme.c | 20 ++++++++++++-------- > 2 files changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig > index de952935b5d2..036cc3f217b1 100644 > --- a/drivers/scsi/qla2xxx/Kconfig > +++ b/drivers/scsi/qla2xxx/Kconfig > @@ -2,6 +2,7 @@ config SCSI_QLA_FC > tristate "QLogic QLA2XXX Fibre Channel Support" > depends on PCI && SCSI > depends on SCSI_FC_ATTRS > + depends on NVME_FC || !NVME_FC > select FW_LOADER > select BTREE > ---help--- > diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c > index 14e25e32e622..9c18d754ac33 100644 > --- a/drivers/scsi/qla2xxx/qla_nvme.c > +++ b/drivers/scsi/qla2xxx/qla_nvme.c > @@ -17,10 +17,12 @@ static void qla_nvme_unregister_remote_port(struct work_struct *); > > int qla_nvme_register_remote(scsi_qla_host_t *vha, fc_port_t *fcport) > { > -#if (IS_ENABLED(CONFIG_NVME_FC)) > struct nvme_rport *rport; > int ret; > > + if (!IS_ENABLED(CONFIG_NVME_FC)) > + return 0; > + > if (fcport->nvme_flag & NVME_FLAG_REGISTERED) > return 0; > > @@ -78,7 +80,6 @@ int qla_nvme_register_remote(scsi_qla_host_t *vha, fc_port_t *fcport) > init_waitqueue_head(&fcport->nvme_waitQ); > rport->fcport = fcport; > list_add_tail(&rport->list, &vha->nvme_rport_list); > -#endif > return 0; > } > > @@ -666,11 +667,13 @@ static void qla_nvme_abort_all(fc_port_t *fcport) > > static void qla_nvme_unregister_remote_port(struct work_struct *work) > { > -#if (IS_ENABLED(CONFIG_NVME_FC)) > struct fc_port *fcport = container_of(work, struct fc_port, > nvme_del_work); > struct nvme_rport *rport, *trport; > > + if (!IS_ENABLED(CONFIG_NVME_FC)) > + return; > + > list_for_each_entry_safe(rport, trport, > &fcport->vha->nvme_rport_list, list) { > if (rport->fcport == fcport) { > @@ -680,16 +683,17 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) > fcport->nvme_remote_port); > } > } > -#endif > } > > void qla_nvme_delete(scsi_qla_host_t *vha) > { > -#if (IS_ENABLED(CONFIG_NVME_FC)) > struct nvme_rport *rport, *trport; > fc_port_t *fcport; > int nv_ret; > > + if (!IS_ENABLED(CONFIG_NVME_FC)) > + return; > + > list_for_each_entry_safe(rport, trport, &vha->nvme_rport_list, list) { > fcport = rport->fcport; > > @@ -711,17 +715,18 @@ void qla_nvme_delete(scsi_qla_host_t *vha) > ql_log(ql_log_info, vha, 0x2115, > "Unregister of localport failed\n"); > } > -#endif > } > > void qla_nvme_register_hba(scsi_qla_host_t *vha) > { > -#if (IS_ENABLED(CONFIG_NVME_FC)) > struct nvme_fc_port_template *tmpl; > struct qla_hw_data *ha; > struct nvme_fc_port_info pinfo; > int ret; > > + if (!IS_ENABLED(CONFIG_NVME_FC)) > + return; > + > ha = vha->hw; > tmpl = &qla_nvme_fc_transport; > > @@ -752,5 +757,4 @@ void qla_nvme_register_hba(scsi_qla_host_t *vha) > atomic_set(&vha->nvme_ref_count, 1); > vha->nvme_local_port->private = vha; > init_waitqueue_head(&vha->nvme_waitQ); > -#endif > } > -- > 2.9.0 > Looks Good. Acked-By: Himanshu Madhani Thanks, - Himanshu