From patchwork Tue Dec 24 08:15:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11309179 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DFAE14B7 for ; Tue, 24 Dec 2019 08:15:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AC8C20706 for ; Tue, 24 Dec 2019 08:15:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c/ZtToZa"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="LH5d5Xb5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AC8C20706 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QwY5KnIuhbGDcn+xMT8HS1GnaasheXPhUbC6xaaAGGc=; b=c/ZtToZa4O/wj3 a1wz+a3JzpVHDYDozL7cw72PL9rWm6S76QVfbNIGPmVQLOlOSCdwwHxJ5SLtnJEcWSeGcCeaX8+Nc PYD4FeF2GjSEe+TqMI5lJV9A1RikDaNg3lm0njwr/9SFF+wH+4WhzSaF1h5wQz5jGu97WII/ewWEI bptN7oLEU94RRqAQECpR056/fvfGSQ0t8hBneRjIEZ8G51+KjNUexcCRwVEE9QeXhjqpFe8cf3Gza bEAKP3967QDU4thiV481XGUaHPsJ7dDuwHXCJlv9xUuOb2I/yCQyW23G+7IXQw/H9jGD73pC4R4Ok 1zmTd4+QIKXuuMqCDJ6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ijfLz-0001hz-Nf; Tue, 24 Dec 2019 08:15:43 +0000 Received: from conuserg-11.nifty.com ([210.131.2.78]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ijfLr-0001Y1-NN for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2019 08:15:37 +0000 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id xBO8F6tP002467; Tue, 24 Dec 2019 17:15:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com xBO8F6tP002467 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1577175313; bh=jKX8H24L9P/kDcEFr52nFIN6vZX1dw3qi1ILU0zzQ1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LH5d5Xb5XetelHCGw0KPciGf1DQ6qgz5oVGoCFofMdCnSzxQwCijuOMxa7tyy8Nae J8ya1rujKnF8/SQ4hvd9Ambys/TIe9W3GoOnvvjH1dNPRxx4KgLuZX662+Kxfx9pGu 6ds95X3thYTUHLzGXLz9Pj3II036sln0SGiZZw84ZI87mGEq6glrS1ebEtSZrP1OlY e+d+TG8oVOFV49EzKMexbjYQZckYB2t92lbIuickAk52vdd8zLIn3jfhvse6zCQbgb +SYsgW6YMNFStKmpRhasFF4QBF7qRQ+ce9KCd2SYzQL/ipqJ8eOF4khF9Tk/rM25+4 z7TBYuHiwL3+w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Will Deacon , Robin Murphy , linux-arm-kernel@lists.infradead.org, Joerg Roedel , iommu@lists.linux-foundation.org Subject: [PATCH 2/2] iommu/arm-smmu: fix -Wunused-const-variable warning Date: Tue, 24 Dec 2019 17:15:00 +0900 Message-Id: <20191224081500.18628-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191224081500.18628-1-yamada.masahiro@socionext.com> References: <20191224081500.18628-1-yamada.masahiro@socionext.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191224_001536_023928_EF9C89A4 X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [210.131.2.78 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org For ARCH=arm builds, OF is not necessarily enabled, that is, you can build this driver without CONFIG_OF. When CONFIG_OF is unset, of_match_ptr() is NULL, and arm_smmu_of_match is left orphan. Building it with W=1 emits a warning: drivers/iommu/arm-smmu.c:1904:34: warning: ‘arm_smmu_of_match’ defined but not used [-Wunused-const-variable=] static const struct of_device_id arm_smmu_of_match[] = { ^~~~~~~~~~~~~~~~~ There are two ways to fix this: - annotate arm_smmu_of_match with __maybe_unused (or surround the code with #ifdef CONFIG_OF ... #endif) - stop using of_match_ptr() This commit took the latter solution. It slightly increases the object size, but it is probably not a big deal because arm_smmu_device_dt_probe() is also compiled irrespective of CONFIG_OF. Signed-off-by: Masahiro Yamada --- drivers/iommu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 4f1a350d9529..0446a3bf6bd0 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2267,7 +2267,7 @@ static const struct dev_pm_ops arm_smmu_pm_ops = { static struct platform_driver arm_smmu_driver = { .driver = { .name = "arm-smmu", - .of_match_table = of_match_ptr(arm_smmu_of_match), + .of_match_table = arm_smmu_of_match, .pm = &arm_smmu_pm_ops, .suppress_bind_attrs = true, },