Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: tps65xxx: Constify static struct resource in OMAP2+ drivers

Constify a number of static struct resource. The only usage of the
structs are to assign their address to the resources field in the
mfd_cell struct. This allows the compiler to put them in read-only
memory. Done with the help of Coccinelle.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Rikard Falkeborn and committed by
Lee Jones
0aefed0e bf4cceb6

+3 -3
+2 -2
drivers/mfd/tps65217.c
··· 33 33 #include <linux/mfd/core.h> 34 34 #include <linux/mfd/tps65217.h> 35 35 36 - static struct resource charger_resources[] = { 36 + static const struct resource charger_resources[] = { 37 37 DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_AC, "AC"), 38 38 DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_USB, "USB"), 39 39 }; 40 40 41 - static struct resource pb_resources[] = { 41 + static const struct resource pb_resources[] = { 42 42 DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_PB, "PB"), 43 43 }; 44 44
+1 -1
drivers/mfd/tps65910.c
··· 21 21 #include <linux/of.h> 22 22 #include <linux/of_device.h> 23 23 24 - static struct resource rtc_resources[] = { 24 + static const struct resource rtc_resources[] = { 25 25 { 26 26 .start = TPS65910_IRQ_RTC_ALARM, 27 27 .end = TPS65910_IRQ_RTC_ALARM,