aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2008-12-05 03:15:39 -0500
committerPaul Mackerras <paulus@samba.org>2008-12-20 22:21:14 -0500
commitc1bb7c6d04ebdf48998649100c5267a9139debf5 (patch)
tree1440c7237862877945d20787589af880c30d16df
parentc280266a326ccabeb64b6d69fa4fd21faf5bf354 (diff)
of: Minor simplification for the of_parse_phandles_with_args()
By using 'list++' in the beginning we can simplify the code a little bit. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--drivers/of/base.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 4f884a358a7b..cf04d4dd4a53 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -547,14 +547,12 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name,
547 const u32 *cells; 547 const u32 *cells;
548 const phandle *phandle; 548 const phandle *phandle;
549 549
550 phandle = list; 550 phandle = list++;
551 args = list + 1; 551 args = list;
552 552
553 /* one cell hole in the list = <>; */ 553 /* one cell hole in the list = <>; */
554 if (!*phandle) { 554 if (!*phandle)
555 list++;
556 goto next; 555 goto next;
557 }
558 556
559 node = of_find_node_by_phandle(*phandle); 557 node = of_find_node_by_phandle(*phandle);
560 if (!node) { 558 if (!node) {
@@ -570,8 +568,7 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name,
570 goto err1; 568 goto err1;
571 } 569 }
572 570
573 /* Next phandle is at offset of one phandle cell + #cells */ 571 list += *cells;
574 list += 1 + *cells;
575 if (list > list_end) { 572 if (list > list_end) {
576 pr_debug("%s: insufficient arguments length\n", 573 pr_debug("%s: insufficient arguments length\n",
577 np->full_name); 574 np->full_name);