Commit c1bb7c6d authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Paul Mackerras

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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent c280266a
...@@ -547,14 +547,12 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name, ...@@ -547,14 +547,12 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name,
const u32 *cells; const u32 *cells;
const phandle *phandle; const phandle *phandle;
phandle = list; phandle = list++;
args = list + 1; args = list;
/* one cell hole in the list = <>; */ /* one cell hole in the list = <>; */
if (!*phandle) { if (!*phandle)
list++;
goto next; goto next;
}
node = of_find_node_by_phandle(*phandle); node = of_find_node_by_phandle(*phandle);
if (!node) { if (!node) {
...@@ -570,8 +568,7 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name, ...@@ -570,8 +568,7 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name,
goto err1; goto err1;
} }
/* Next phandle is at offset of one phandle cell + #cells */ list += *cells;
list += 1 + *cells;
if (list > list_end) { if (list > list_end) {
pr_debug("%s: insufficient arguments length\n", pr_debug("%s: insufficient arguments length\n",
np->full_name); np->full_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment