All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Cartwright <joshc@codeaurora.org>
To: Nicolas Pitre <nicolas.pitre@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>,
	linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] bus: arm-cci: make use of of_find_matching_node_and_match
Date: Tue, 11 Feb 2014 10:23:59 -0600	[thread overview]
Message-ID: <1392135847-30791-2-git-send-email-joshc@codeaurora.org> (raw)
In-Reply-To: <1392135847-30791-1-git-send-email-joshc@codeaurora.org>

Instead of the of_find_matching_node()/of_match_node() pair, which requires two
iterations through the match table, make use of of_find_matching_node_and_match(),
which only iterates through the table once.

This also has the side effect of fixing the following following error hit
during randconfig testing:

  drivers/bus/arm-cci.c: In function ‘cci_probe’:
  drivers/bus/arm-cci.c:976:49: warning: dereferencing ‘void *’ pointer [enabled by default]
    cci_config = of_match_node(arm_cci_matches, np)->data;
                                                   ^
  drivers/bus/arm-cci.c:976:49: error: request for member ‘data’ in something not a structure or union

Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
---
 drivers/bus/arm-cci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 962fd35..e249cdb2 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -962,6 +962,7 @@ static const struct of_device_id arm_cci_ctrl_if_matches[] = {
 
 static int cci_probe(void)
 {
+	const struct of_device_id *match;
 	struct cci_nb_ports const *cci_config;
 	int ret, i, nb_ace = 0, nb_ace_lite = 0;
 	struct device_node *np, *cp;
@@ -969,11 +970,11 @@ static int cci_probe(void)
 	const char *match_str;
 	bool is_ace;
 
-	np = of_find_matching_node(NULL, arm_cci_matches);
+	np = of_find_matching_node_and_match(NULL, arm_cci_matches, &match);
 	if (!np)
 		return -ENODEV;
 
-	cci_config = of_match_node(arm_cci_matches, np)->data;
+	cci_config = match->data;
 	if (!cci_config)
 		return -ENODEV;
 
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


WARNING: multiple messages have this Message-ID (diff)
From: Josh Cartwright <joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Nicolas Pitre
	<nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	Lorenzo Pieralisi
	<lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>,
	Sudeep KarkadaNagesha
	<sudeep.karkadanagesha-5wv7dgnIgG8@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [PATCH 1/8] bus: arm-cci: make use of of_find_matching_node_and_match
Date: Tue, 11 Feb 2014 10:23:59 -0600	[thread overview]
Message-ID: <1392135847-30791-2-git-send-email-joshc@codeaurora.org> (raw)
In-Reply-To: <1392135847-30791-1-git-send-email-joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

Instead of the of_find_matching_node()/of_match_node() pair, which requires two
iterations through the match table, make use of of_find_matching_node_and_match(),
which only iterates through the table once.

This also has the side effect of fixing the following following error hit
during randconfig testing:

  drivers/bus/arm-cci.c: In function ‘cci_probe’:
  drivers/bus/arm-cci.c:976:49: warning: dereferencing ‘void *’ pointer [enabled by default]
    cci_config = of_match_node(arm_cci_matches, np)->data;
                                                   ^
  drivers/bus/arm-cci.c:976:49: error: request for member ‘data’ in something not a structure or union

Signed-off-by: Josh Cartwright <joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
---
 drivers/bus/arm-cci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 962fd35..e249cdb2 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -962,6 +962,7 @@ static const struct of_device_id arm_cci_ctrl_if_matches[] = {
 
 static int cci_probe(void)
 {
+	const struct of_device_id *match;
 	struct cci_nb_ports const *cci_config;
 	int ret, i, nb_ace = 0, nb_ace_lite = 0;
 	struct device_node *np, *cp;
@@ -969,11 +970,11 @@ static int cci_probe(void)
 	const char *match_str;
 	bool is_ace;
 
-	np = of_find_matching_node(NULL, arm_cci_matches);
+	np = of_find_matching_node_and_match(NULL, arm_cci_matches, &match);
 	if (!np)
 		return -ENODEV;
 
-	cci_config = of_match_node(arm_cci_matches, np)->data;
+	cci_config = match->data;
 	if (!cci_config)
 		return -ENODEV;
 
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: joshc@codeaurora.org (Josh Cartwright)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] bus: arm-cci: make use of of_find_matching_node_and_match
Date: Tue, 11 Feb 2014 10:23:59 -0600	[thread overview]
Message-ID: <1392135847-30791-2-git-send-email-joshc@codeaurora.org> (raw)
In-Reply-To: <1392135847-30791-1-git-send-email-joshc@codeaurora.org>

Instead of the of_find_matching_node()/of_match_node() pair, which requires two
iterations through the match table, make use of of_find_matching_node_and_match(),
which only iterates through the table once.

This also has the side effect of fixing the following following error hit
during randconfig testing:

  drivers/bus/arm-cci.c: In function ?cci_probe?:
  drivers/bus/arm-cci.c:976:49: warning: dereferencing ?void *? pointer [enabled by default]
    cci_config = of_match_node(arm_cci_matches, np)->data;
                                                   ^
  drivers/bus/arm-cci.c:976:49: error: request for member ?data? in something not a structure or union

Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
---
 drivers/bus/arm-cci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 962fd35..e249cdb2 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -962,6 +962,7 @@ static const struct of_device_id arm_cci_ctrl_if_matches[] = {
 
 static int cci_probe(void)
 {
+	const struct of_device_id *match;
 	struct cci_nb_ports const *cci_config;
 	int ret, i, nb_ace = 0, nb_ace_lite = 0;
 	struct device_node *np, *cp;
@@ -969,11 +970,11 @@ static int cci_probe(void)
 	const char *match_str;
 	bool is_ace;
 
-	np = of_find_matching_node(NULL, arm_cci_matches);
+	np = of_find_matching_node_and_match(NULL, arm_cci_matches, &match);
 	if (!np)
 		return -ENODEV;
 
-	cci_config = of_match_node(arm_cci_matches, np)->data;
+	cci_config = match->data;
 	if (!cci_config)
 		return -ENODEV;
 
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  reply	other threads:[~2014-02-11 16:26 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 16:23 [PATCH 0/8] of_find_matching_node/of_match_node -> of_find_matching_node_and_match Josh Cartwright
2014-02-11 16:23 ` Josh Cartwright
2014-02-11 16:23 ` Josh Cartwright [this message]
2014-02-11 16:23   ` [PATCH 1/8] bus: arm-cci: make use of of_find_matching_node_and_match Josh Cartwright
2014-02-11 16:23   ` Josh Cartwright
2014-02-11 16:24 ` [PATCH 2/8] bus: mvebu-mbus: " Josh Cartwright
2014-02-11 16:24   ` Josh Cartwright
2014-02-11 16:39   ` Jason Cooper
2014-02-11 16:39     ` Jason Cooper
2014-02-11 16:39     ` Jason Cooper
2014-02-11 19:22   ` Jason Cooper
2014-02-11 19:22     ` Jason Cooper
2014-02-11 16:24 ` [PATCH 3/8] ARM: at91: " Josh Cartwright
2014-02-11 16:24   ` Josh Cartwright
2014-02-11 17:46   ` Nicolas Ferre
2014-02-11 17:46     ` Nicolas Ferre
2014-02-11 17:46     ` Nicolas Ferre
2014-02-11 18:44     ` Josh Cartwright
2014-02-11 18:44       ` Josh Cartwright
2014-02-11 18:44       ` Josh Cartwright
2014-02-11 16:24 ` [PATCH 4/8] ARM: mvebu: " Josh Cartwright
2014-02-11 16:24   ` Josh Cartwright
2014-02-11 16:24   ` Josh Cartwright
2014-02-11 16:41   ` Thomas Petazzoni
2014-02-11 16:41     ` Thomas Petazzoni
2014-02-11 16:41     ` Thomas Petazzoni
2014-02-11 16:53   ` Jason Cooper
2014-02-11 16:53     ` Jason Cooper
2014-02-11 16:53     ` Jason Cooper
2014-02-11 17:10     ` Thomas Petazzoni
2014-02-11 17:10       ` Thomas Petazzoni
2014-02-11 17:10       ` Thomas Petazzoni
2014-02-11 17:31       ` Gregory CLEMENT
2014-02-11 17:31         ` Gregory CLEMENT
2014-02-11 17:31         ` Gregory CLEMENT
2014-02-11 17:34         ` Jason Cooper
2014-02-11 17:34           ` Jason Cooper
2014-02-11 17:34           ` Jason Cooper
2014-02-11 17:43           ` Josh Cartwright
2014-02-11 17:43             ` Josh Cartwright
2014-02-11 19:29   ` Jason Cooper
2014-02-11 19:29     ` Jason Cooper
2014-02-11 16:24 ` [PATCH 5/8] ARM: prima2: " Josh Cartwright
2014-02-11 16:24   ` Josh Cartwright
2014-02-11 16:24 ` [PATCH 6/8] ARM: l2x0: " Josh Cartwright
2014-02-11 16:24   ` Josh Cartwright
2014-02-11 16:24 ` [PATCH 7/8] C6X: " Josh Cartwright
2014-02-11 16:24 ` [PATCH 8/8] cpufreq: ppc: " Josh Cartwright
2014-02-12  5:01   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392135847-30791-2-git-send-email-joshc@codeaurora.org \
    --to=joshc@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=sudeep.karkadanagesha@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.