u-boot-brain/drivers/pinctrl/uniphier
Masahiro Yamada 935e09cdcb pinctrl: uniphier: fix unused-const-variable warnings for GCC 6.x
Marek reports warnings in UniPhier pinctrl drivers when compiled by
GCC 6.x, like:

  drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c:58:18: warning:
  'usb3_muxvals' defined but not used [-Wunused-const-variable=]
   static const int usb3_muxvals[] = {0, 0};
                    ^~~~~~~~~~~~

My intention here is to compile minimum set of pin data for SPL to
save memory footprint, but GCC these days is clever enough to notice
unused data arrays.

We can fix it by sprinkling around __maybe_unused on those arrays,
but I did not do that because they are counterparts of the pinctrl
drivers in Linux.  All the pin data were just copy-pasted from Linux
and are kept in sync for maintainability.

I chose a bit tricky way to fix the issue; calculate ARRAY_SIZE of
*_pins and *_muxvals and set their sum to an unused struct member.
This trick will satisfy GCC because the data arrays are used anyway,
but such data arrays will be dropped from the final binary because
the pointers to them are not used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Marek Vasut <marex@denx.de>
2016-10-18 14:06:46 +09:00
..
Kconfig pinctrl: uniphier: add UniPhier sLD3 pinctrl driver 2016-09-18 23:10:17 +09:00
Makefile pinctrl: uniphier: add UniPhier sLD3 pinctrl driver 2016-09-18 23:10:17 +09:00
pinctrl-uniphier-core.c pinctrl: uniphier: support 4bit-width pin-mux register capability 2016-09-18 23:10:11 +09:00
pinctrl-uniphier-ld4.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-ld6b.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-ld11.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-ld20.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-pro4.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-pro5.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-pxs2.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier-sld3.c pinctrl: uniphier: add UniPhier sLD3 pinctrl driver 2016-09-18 23:10:17 +09:00
pinctrl-uniphier-sld8.c pinctrl: uniphier: add System Bus pin-mux settings 2016-09-14 22:54:19 +09:00
pinctrl-uniphier.h pinctrl: uniphier: fix unused-const-variable warnings for GCC 6.x 2016-10-18 14:06:46 +09:00