Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp877061pxa; Thu, 27 Aug 2020 19:20:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/FJAHgFtXUfn9fTybK/N3OGlJ2pvSKxCTw3dw5d4iqRuP/W9wLwfJuvghNKCEVi9KV13O X-Received: by 2002:a17:906:9589:: with SMTP id r9mr23145112ejx.320.1598581254416; Thu, 27 Aug 2020 19:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598581254; cv=none; d=google.com; s=arc-20160816; b=Ff+AIUnXwjnzdkZL5B3ynCXw4RVMzeLYFiq8rSjIFDS0BZSLLyrTIAXOYignAIQNrC XLMDVb2Ryz+oQjvLoF4mh1/igUVIUljyT25urWzmYFCz4sWXmifbQXCU57061fsbJrFO CwyaQtGYDPfkjKc045gdabLxQm48zlkyU4hzELjQZtReh29HUO2SU0DhRAN1mV8GLL6Z IhY3aXezLXwzEm956CV+isNcCrcfpO/ODWkq9aF8B3nDXzWGo3evpYg5I70VUeOJeNeX MPzGuXQ84LJ8dz+on+wHgiN7Xq6jwnmAR/Z4EUqS7CLpWd7vJvmNb1ahW4tnHUVqGycX kiDQ== 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 :message-id:date:subject:cc:to:from; bh=tzJU4TxsDjJC6cunykNIBXwI30gMwNwNIncGbCpelww=; b=QwuRnj15R5f+azyvRu7g66IuatoLpj6a8B6pW0QrP/FhfsmSm7XiywjuJAzLZvTgfI 6H56oe+LoxMl2rVVQkXy0Lclx+e2UfgNCgfoHnjFuwhYIUno1v9hsYtSxQtHBBWvGbPo vgbsQCQC8FfAX/psbkTV6LCuxV03NFG0YIWwQcGdGTniTMV8R7B22y35mUKH7WZ/fQBR A8tm09AQlNkJ7f5WN1xsCFxszJQM+c3Up8SC8qt4X6b7k0aE2w572f1ncrn42PfUwP3T /I8saI7gt0DyQNzvemwDQGkv5I3NCFoLn9IGCnrQJZTjbHtD/D9KEBzGuUwLgbbPNlH8 ZoBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si923557eds.200.2020.08.27.19.20.31; Thu, 27 Aug 2020 19:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728268AbgH1CUC (ORCPT + 99 others); Thu, 27 Aug 2020 22:20:02 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:57288 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbgH1CUC (ORCPT ); Thu, 27 Aug 2020 22:20:02 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kBTzk-00CDlN-DK; Fri, 28 Aug 2020 04:20:00 +0200 From: Andrew Lunn To: robh+dt@kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn Subject: [PATCH] of: of_match_node: Make stub an inline function to avoid W=1 warnings Date: Fri, 28 Aug 2020 04:19:39 +0200 Message-Id: <20200828021939.2912798-1-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building without CONFIG_OF and W=1, errors are given about unused arrays of match data, because of_match_node is stubbed as a macro. The compile does not see it takes parameters when not astub, so it generates warnings about unused variables. Replace the stub with an inline function to avoid these false warnings. Signed-off-by: Andrew Lunn --- include/linux/of.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/of.h b/include/linux/of.h index 5cf7ae0465d1..e9838387e7d9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -991,7 +991,12 @@ static inline int of_map_id(struct device_node *np, u32 id, } #define of_match_ptr(_ptr) NULL -#define of_match_node(_matches, _node) NULL + +static inline const struct of_device_id *of_match_node( + const struct of_device_id *matches, const struct device_node *node) +{ + return NULL; +} #endif /* CONFIG_OF */ /* Default string compare functions, Allow arch asm/prom.h to override */ -- 2.28.0