Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3342545yba; Mon, 6 May 2019 22:52:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGp707SAfA1mElSrtJlsoNyO3TTHYiSypMCvvhQIImg5Q1hi9yOTBNnKJ9EVxYxWmaMYgU X-Received: by 2002:a17:902:1602:: with SMTP id g2mr37917964plg.325.1557208352326; Mon, 06 May 2019 22:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557208352; cv=none; d=google.com; s=arc-20160816; b=sN3cDaMf9JFZ7HmVwauzSu71/ehvUxcArSjGOftExGrScOowrhETi//DyXM1GLOJgP pZuzQTc7f/Betk0xM8pBo3L6/DtnKf5yWq1sQ2IGIeYgW0WoGU0AzjKuT7F7VZpXrId+ hBG3zgnoI1rGDwLTQIrQPLrXSRx+Itt+68xkiK/rJmzNy6I/7JZ5jHIcZG0XcgbxIbmi eUihFOV8DUVZqGnysvEnJ85HpzKfIzaWnZXgJvshlqCeDvNZSTEG5rbpac26MRD//7lP WKKibZxcMoUGWtwiZCmbzGNLvLI9GIhUPNXZ8sHBU2WJNlT7pZ3lzqEcSrJDnD9DxswP /mtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zRnH+59TkCQuDG5ZbNGMQl55g3MgDHRivbl/HWOkUKc=; b=gN8ZCEndoqDIMY65a7onotAT5WIpHF6+LCJ8F7LfV839FD/7X0uAyafIMrh7zYffVf d7aEmsK971vcYnndUfRDzAWS1vaospanWSDpaxVST/OvpyUbma2bXphLqnhDRIU/QFrC cyjUNDO/9REYOSoIJf6zrPmwyQeTLgwcABFQMcU3niHg6QmgHTRPr9PdmtycjnExSW0p IdMysJs4fsEnhN9obss/XGmJZdf9EEBImoGTlxpUhFIvh1Y+PuYZlh2rfClWg2+KFXGF DhUPvLPz4N3/Z6MJvBlM2aJH6K67CME+MYlTov473zNW8aYBnGhTvGa5tkzsbv7DU/9m hUtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M15DwTna; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si16718332pgq.334.2019.05.06.22.52.16; Mon, 06 May 2019 22:52:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M15DwTna; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729105AbfEGFuQ (ORCPT + 99 others); Tue, 7 May 2019 01:50:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729042AbfEGFkN (ORCPT ); Tue, 7 May 2019 01:40:13 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D38E214AE; Tue, 7 May 2019 05:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557207612; bh=0lXt05TCRZdQkuVRMf8JxGKjSOx8H7tZZ4rq+/yUapg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M15DwTnazETUyojdPwDWNKfgfFiSJStb1YFGtXqCjehpDYxEEGfQXmwQcZLX/oAg2 8mUmyUiuWxZb9xCpYGA3p6rfTqlszRxcONeRDYCMAiaWrOHVsQntJpWpmyfgyUK6XF mUD1k0QBa3MyuW7peoSALDhUOMUSWvbUl12XCj2s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 56/95] scsi: raid_attrs: fix unused variable warning Date: Tue, 7 May 2019 01:37:45 -0400 Message-Id: <20190507053826.31622-56-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190507053826.31622-1-sashal@kernel.org> References: <20190507053826.31622-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 0eeec01488da9b1403c8c29e73eacac8af9e4bf2 ] 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 Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/raid_class.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c index 2c146b44d95f..cddd78893b46 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; } -- 2.20.1