]> git.baikalelectronics.ru Git - kernel.git/commit
of: restructure for_each macros to fix compile warnings
authorRob Herring <robh@kernel.org>
Mon, 3 Feb 2014 14:53:44 +0000 (08:53 -0600)
committerRob Herring <robh@kernel.org>
Wed, 5 Feb 2014 15:51:54 +0000 (09:51 -0600)
commit1d52b7986c4cbb0e5c5c8a84e16a59cd44d16cc9
tree3bae78a163360b86e61ecd76208d9611b2c1f777
parentdd30ab0ad5fdef29203481c79f8f691b494cf055
of: restructure for_each macros to fix compile warnings

Commit 6035c7453d "include/linux/of.h: make for_each_child_of_node()
reference its args when CONFIG_OF=n" fixed warnings for unused
variables, but introduced variable "used uninitialized" warnings.
Simply initializing the variables would result in "set but not used"
warnings with W=1.

Fix both types of warnings by making all the for_each macros
unconditional and rely on the dummy static inline functions to
initialize and reference any variables.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
include/linux/of.h