diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-11-20 16:12:20 -0700 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-11-20 22:58:55 -0600 |
commit | 50c8af4cf98fd97d6779f244215154e4c89699c7 (patch) | |
tree | 9690d810d1eef4b5dc8a26824dc699bbb4d54f44 /drivers/acpi/ac.c | |
parent | be193249b4178158c0f697cb452b2bbf0cb16361 (diff) |
of: introduce for_each_matching_node_and_match()
The following pattern of code is tempting:
for_each_matching_node(np, table) {
match = of_match_node(table, np);
However, this results in iterating over table twice; the second time
inside of_match_node(). The implementation of for_each_matching_node()
already found the match, so this is redundant. Invent new function
of_find_matching_node_and_match() and macro
for_each_matching_node_and_match() to remove the double iteration,
thus transforming the above code to:
for_each_matching_node_and_match(np, table, &match)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'drivers/acpi/ac.c')
0 files changed, 0 insertions, 0 deletions