linux-stable/drivers/pinctrl/nomadik
Gustavo A. R. Silva d3761023e7 pinctrl: nomadik: abx500: constify gpio_chip structure
This structure is only used to copy into another structure, so declare
it as const.

This issue was detected using Coccinelle and the following semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct gpio_chip i@p = { ... };

@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct gpio_chip e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct gpio_chip i = { ... };

In the following log you can see a significant difference in the code size
and data segment, hence in the dec segment. This log is the output
of the size command, before and after the code change:

before:
   text    data     bss     dec     hex filename
  17545    5376       0   22921    5989 drivers/pinctrl/nomadik/pinctrl-abx500.o

after:
            bss     dec     hex filename
  17273    5320       0   22593    5841 drivers/pinctrl/nomadik/pinctrl-abx500.o

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-08-14 15:00:59 +02:00
..
Kconfig pinctrl: fix allmodconfig noise 2015-04-15 10:02:42 +02:00
Makefile
pinctrl-ab8500.c
pinctrl-ab8505.c pinctrl: Spelling s/reseved/reserved/ 2015-06-01 15:49:53 +02:00
pinctrl-ab8540.c
pinctrl-ab9540.c
pinctrl-abx500.c pinctrl: nomadik: abx500: constify gpio_chip structure 2017-08-14 15:00:59 +02:00
pinctrl-abx500.h
pinctrl-nomadik-db8500.c pinctrl: nomadik: split up and comments MC0 pins 2016-11-18 09:54:32 +01:00
pinctrl-nomadik-db8540.c pinctrl/ARM: move GPIO and pinctrl deps to device tree 2015-07-27 15:04:40 +02:00
pinctrl-nomadik-stn8815.c pinctrl: nomadik: stn8815 CLCD alternate functions 2016-01-28 12:26:34 +01:00
pinctrl-nomadik.c pinctrl: nomadik: don't default-flag IRQs as falling 2016-09-19 11:01:33 +02:00
pinctrl-nomadik.h pinctrl/ARM: move GPIO and pinctrl deps to device tree 2015-07-27 15:04:40 +02:00