Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933469AbdHYPBM (ORCPT ); Fri, 25 Aug 2017 11:01:12 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:40509 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932326AbdHYPBL (ORCPT ); Fri, 25 Aug 2017 11:01:11 -0400 From: Eugeniy Paltsev To: devicetree@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Frank Rowand , Steven Rostedt , Eugeniy Paltsev Subject: [PATCH] OF: move extern declarations of entry pointers inside ifdef Date: Fri, 25 Aug 2017 18:00:26 +0300 Message-Id: <20170825150027.25341-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1835 Lines: 55 Move extern declarations of "of_root", "of_chosen", "of_aliases", "of_stdout" pointers inside "CONFIG_OF" ifdef to be able to get rid of "CONFIG_OF" ifdef in their usage places. Suggested-by: Steven Rostedt Signed-off-by: Eugeniy Paltsev --- For example see: https://lkml.org/lkml/2017/8/25/337 include/linux/of.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/include/linux/of.h b/include/linux/of.h index cfc3411..d117bf1 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -131,11 +131,6 @@ static inline struct device_node *of_node_get(struct device_node *node) static inline void of_node_put(struct device_node *node) { } #endif /* !CONFIG_OF_DYNAMIC */ -/* Pointer for first entry in chain of all nodes. */ -extern struct device_node *of_root; -extern struct device_node *of_chosen; -extern struct device_node *of_aliases; -extern struct device_node *of_stdout; extern raw_spinlock_t devtree_lock; /* flag descriptions (need to be visible even when !CONFIG_OF) */ @@ -147,6 +142,12 @@ extern raw_spinlock_t devtree_lock; #define OF_BAD_ADDR ((u64)-1) #ifdef CONFIG_OF +/* Pointer for first entry in chain of all nodes. */ +extern struct device_node *of_root; +extern struct device_node *of_chosen; +extern struct device_node *of_aliases; +extern struct device_node *of_stdout; + void of_core_init(void); static inline bool is_of_node(const struct fwnode_handle *fwnode) @@ -539,6 +540,10 @@ const char *of_prop_next_string(struct property *prop, const char *cur); bool of_console_check(struct device_node *dn, char *name, int index); #else /* CONFIG_OF */ +#define of_root NULL +#define of_chosen NULL +#define of_aliases NULL +#define of_stdout NULL static inline void of_core_init(void) { -- 2.9.3