From: Stephen Warren Date: Tue, 20 Nov 2012 23:12:20 +0000 (-0700) Subject: of: introduce for_each_matching_node_and_match() X-Git-Tag: omap-for-v3.8/fixes-for-merge-window-v4-signed~89^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50c8af4cf98fd97d6779f244215154e4c89699c7;p=pandora-kernel.git 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 Signed-off-by: Rob Herring --- Reading git-diff-tree failed