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: 182433 Delivered-To: patch@linaro.org Received: by 2002:a92:a146:0:0:0:0:0 with SMTP id v67csp1393912ili; Tue, 24 Dec 2019 00:16:08 -0800 (PST) X-Google-Smtp-Source: APXvYqySE2tY4+uXWaq6Cz1+mVaid9XBnrL/PE4CwdPEnV97yu1kw/p9Ar7qGyxWMFxpL5SiIOzd X-Received: by 2002:a05:6830:22e3:: with SMTP id t3mr35485272otc.193.1577175368039; Tue, 24 Dec 2019 00:16:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577175368; cv=none; d=google.com; s=arc-20160816; b=ygT2JHgUMPhaVW5mMa4DF6al5r5tJUalTNI26J6Bsactne60R7DULUR9CEARXpfM6q L/j5tCwKcShgJCz/jAp1NeSxFyFUTj7wCRm4T4HN77qkbFMe+emmMvXcRTvbg0OidxCp B+fqo3skYEIEPrRS0aF0RF7S4WYx3FD5SG0FNt/pa5mTsWeLhg2N6UvFaG/A/icXuJlp cfQbt0dNdbGqGxi14SIWR6v7Aw1F0Yu+5bWDWHZH6b52cYg++iVubjoVGYqhZE+EdzVp WhLR7IZZZxesp6oOHS7iJGcO584cvwN8lMEiJoeTjJprAa79xG7KyvCR+xvktUOzOjcg YYvQ== 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:dkim-filter; bh=jKX8H24L9P/kDcEFr52nFIN6vZX1dw3qi1ILU0zzQ1g=; b=dk1W81THCSrTjexwjV/WEYRNkZdj0lU0cWf7g8WKoWxpSZ3z5wESqIn565g4NGnS4W 2vWahyDYt+YGawz2jv43Kx5uJ6ul7Ixk3IunMUU5kXB3bp8JHUr8Tc1X+uS0GmuhMoIi yM30NK6tR4JdpYHzW5dmXY//lQN0Y+oL/uj31ERfOns9tTUwWFpy89Vw/CrDeDTSziTt jHLPkPLvLG/pTQrXI+2U1bs4dqiULFZeaItazjpza0FUjGTY44hDq1XzETNnktFmQRhT kHTOUH5G7y0ybwc1Tb/fvXrprZpEPW8eX0px4vKioJcZrGIhxfRk5xjJ/BKIvLPtt11M RgJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=LH5d5Xb5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si10603012oii.249.2019.12.24.00.16.07; Tue, 24 Dec 2019 00:16:08 -0800 (PST) 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=@nifty.com header.s=dec2015msa header.b=LH5d5Xb5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726331AbfLXIQG (ORCPT + 27 others); Tue, 24 Dec 2019 03:16:06 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61759 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbfLXIQD (ORCPT ); Tue, 24 Dec 2019 03:16:03 -0500 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 Cc: Masahiro Yamada , linux-kernel@vger.kernel.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.1 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, },