u-boot-brain/drivers/pinctrl
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
..
ath79 drivers: pinctrl: Add simple pinctrl driver for Qualcomm/Atheros qca953x. 2016-05-21 01:25:50 +02:00
exynos libfdt: Bring in upstream stringlist functions 2016-10-13 13:54:10 -06:00
meson libfdt: Sync fdt_for_each_subnode() with upstream 2016-10-13 14:10:32 -06:00
nxp pinctrl: imx: do not announce driver initialization 2016-10-07 12:26:14 +02:00
rockchip pinctrl: add driver for rk3399 2016-09-22 07:32:22 -06:00
uniphier pinctrl: uniphier: fix unused-const-variable warnings for GCC 6.x 2016-10-18 14:06:46 +09:00
Kconfig pinctrl: add driver for rk3399 2016-09-22 07:32:22 -06:00
Makefile pinctrl: add driver for meson-gxbb pin controller 2016-09-06 13:18:19 -04:00
pinctrl_pic32.c dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: Add pinctrl driver 2016-08-15 22:58:03 +02:00
pinctrl-generic.c libfdt: Bring in upstream stringlist functions 2016-10-13 13:54:10 -06:00
pinctrl-sandbox.c pinctrl: sandbox: add sandbox pinctrl driver 2015-08-31 07:57:29 -06:00
pinctrl-uclass.c libfdt: Bring in upstream stringlist functions 2016-10-13 13:54:10 -06:00