From patchwork Mon Aug 13 22:27:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144058 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3592704ljj; Mon, 13 Aug 2018 15:28:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyb1wNEMxHFhbER5g1MO8kZ2N9PxWz9JWdVnW2kPlfSw4vV4Kt55Yrhl1EHrRjfrqBphv2j X-Received: by 2002:a17:902:760b:: with SMTP id k11-v6mr18226209pll.91.1534199285385; Mon, 13 Aug 2018 15:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534199285; cv=none; d=google.com; s=arc-20160816; b=yr2IfsvHIuoV+tnTL+eKjaBAR2LMiUvPetkIZpTR09MWAkNEPg+UQ/jzRd8Gnqb6Cz t205oMMRfCo2JVPspbh+mDPAgnSNNrHi2cAk7vn/umpJPcPfLHUB6pFEa65e1sjRH8lv FhlvRi0nDS79KMAqkQ4/hfHvd3oMUKwnFhSiUEQowt3bxxpccyYWMjBhJK4ugCXPLkbH /ADukLUSsJURngRxoqVlWrNyX9A0OXlQm9xU360USr6LwOFti9A4/p+5LKVBo16tj0zC 6ziRNdNHrns4on7vcAFreLAchzDj7vmtpqKlUeZikBcn6lr+YYbLr3twAUSPk2zect/i COGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uN31VkwZiLp6wILeeZSZe/cOFeYCj13s0d3nfFwT/2o=; b=PDLnLBre1yxLroUo3nJZyxLyVobftO/mwwoyKmeTemMy6PgTcfgCLKNatH49XaDW/o KtwHAmmt/HqdBRgc7tSuSoCh/ju3QPj7i6eprUW9SBePwYfDet3K6QscB1RD08+HYRmP HlTFtWivpDz7vZX7Pk9XwV92h/qbEcwEDrPpU7yEkE/rqfjPbiNfH23wRt1gDFALSJds T3Xqk7ck5vAyPoAsaHy1WKdUjwOxb/VcNDto4X460EIruUSIcyrSr0/LxwnRTqXZ7Fal DMAIA+F2AezM0jnmlnOg2d/UO8ZGVLgH4DZjjv+7XKot9JDsHf2MHU83d7ria4iro2Qb IoNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23-v6si15004643pgv.518.2018.08.13.15.28.05; Mon, 13 Aug 2018 15:28:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730352AbeHNBMQ (ORCPT + 1 other); Mon, 13 Aug 2018 21:12:16 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:48647 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730014AbeHNBMQ (ORCPT ); Mon, 13 Aug 2018 21:12:16 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M9Xn5-1fjbk83rxf-00CyzG; Tue, 14 Aug 2018 00:27:52 +0200 From: Arnd Bergmann To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Hannes Reinecke , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: raid_attrs: fix unused variable warning Date: Tue, 14 Aug 2018 00:27:10 +0200 Message-Id: <20180813222716.757523-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:G83hKnPfELFS14NHqmVoVsyoZifnmtwcSKL1534MHASH49g7VFj b2xtqQzW3/dq0iSZU/R2bt7DAV54mnAyfdX5iFMmYASO4t88/bM14zk5rfcuHDdC2CSFtVc xZEdTX2qPIy08SbR0/7/HU/u+/apHJnCARD7RwrRltm8YaTHeMdNIqpE9j73DCbc6Og4nkP s8ySeLNyCw9/BCPHS280Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:SsmWaniqVT0=:/t3gC+vO0QDcj0Sa9S2vPO 0vhs2gi8r/fkko10PYZg4O2zyNCr+qo3DtNSVV4a50TDL4mR8uRcfQqPYv66UsWlB8r7YhyX9 2kjMzY4DMZnS8GaULKZgfkBz4OrUKBx4Lwv3B9r1xkcE2ZrUJG4AhzM6Y/9pCEs0URtJiKQC0 0IMqo6KT+EXx/bpBEvlfVV1RXkeD8GEG7jW4BXKfOewM1lBjmbmzAqK//O5sa4hr+s6RfKG6G IC7yGc7UvPQglIInpcImt4rG6N3VJazdRizTSYmYlCunTxOuoIyM0c203KZXctpvs2dEEru0u Y6vhcv2UaUQ/CAF6glWm0httyOF9gDfyRFK7RiZd5Pknf3AuJLracg0JjuCaWvBthcc61gdmf yQKYhDb6kLTkR5xsoWoPp8ZHuzUUZoxp4tviPq9IgMdEiltvrYWKRufFZf5iT8VxhIHXI+9vT AdVk4xquXGAziYoZGqe1ZkJ0cWYRNKkrer98sxa0CA38+vQjpAF2oScCE91WigzNLx8fmifKS ZJsSyZ1dbxubNSwdcZzojTXxB9psEVkfYdM0yjLyw0hrjLpvH/ivM9ERiUfyq/5Jlx4SvKZYf s3sdi2Ubink1qIHSIMSV5VBngBcAAzWlXTUZMBLDpcyYECPSS5mptrjT7Qa3C4LxR0f8mgm2b QGR7NnpxJAIrA2cgtrP11jZuT7u6tfcXS3uTqbqYj9uoAO7tJlqe7bjwBm+BKvCcXVIM= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org I ran into a new warning on randconfig kernels: drivers/scsi/raid_class.c: In function 'raid_match': drivers/scsi/raid_class.c:64:24: error: unused variable 'i' [-Werror=unused-variable] This looks like a very old problem that for some reason was very hard to run into, but it is very easy to fix, by replacing the incorrect #ifdef with a simpler IS_ENABLED() check. Fixes: fac829fdcaf4 ("[SCSI] raid_attrs: fix dependency problems") Signed-off-by: Arnd Bergmann --- drivers/scsi/raid_class.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.18.0 diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c index ea88906d2cc5..5c3d6e1e0145 100644 --- a/drivers/scsi/raid_class.c +++ b/drivers/scsi/raid_class.c @@ -63,8 +63,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev) * emulated RAID devices, so start with SCSI */ struct raid_internal *i = ac_to_raid_internal(cont); -#if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE) - if (scsi_is_sdev_device(dev)) { + if (IS_ENABLED(CONFIG_SCSI) && scsi_is_sdev_device(dev)) { struct scsi_device *sdev = to_scsi_device(dev); if (i->f->cookie != sdev->host->hostt) @@ -72,7 +71,6 @@ static int raid_match(struct attribute_container *cont, struct device *dev) return i->f->is_raid(dev); } -#endif /* FIXME: look at other subsystems too */ return 0; }