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

mfd: intel: Constify static struct resource

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>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Rikard Falkeborn and committed by
Lee Jones
bf4cceb6 a0fa0abe

+28 -28
+9 -9
drivers/mfd/intel_msic.c
··· 50 50 void __iomem *irq_base; 51 51 }; 52 52 53 - static struct resource msic_touch_resources[] = { 53 + static const struct resource msic_touch_resources[] = { 54 54 DEFINE_RES_IRQ(0), 55 55 }; 56 56 57 - static struct resource msic_adc_resources[] = { 57 + static const struct resource msic_adc_resources[] = { 58 58 DEFINE_RES_IRQ(0), 59 59 }; 60 60 61 - static struct resource msic_battery_resources[] = { 61 + static const struct resource msic_battery_resources[] = { 62 62 DEFINE_RES_IRQ(0), 63 63 }; 64 64 65 - static struct resource msic_gpio_resources[] = { 65 + static const struct resource msic_gpio_resources[] = { 66 66 DEFINE_RES_IRQ(0), 67 67 }; 68 68 69 - static struct resource msic_audio_resources[] = { 69 + static const struct resource msic_audio_resources[] = { 70 70 DEFINE_RES_IRQ_NAMED(0, "IRQ"), 71 71 /* 72 72 * We will pass IRQ_BASE to the driver now but this can be removed ··· 75 75 DEFINE_RES_MEM_NAMED(MSIC_IRQ_STATUS_ACCDET, 1, "IRQ_BASE"), 76 76 }; 77 77 78 - static struct resource msic_hdmi_resources[] = { 78 + static const struct resource msic_hdmi_resources[] = { 79 79 DEFINE_RES_IRQ(0), 80 80 }; 81 81 82 - static struct resource msic_thermal_resources[] = { 82 + static const struct resource msic_thermal_resources[] = { 83 83 DEFINE_RES_IRQ(0), 84 84 }; 85 85 86 - static struct resource msic_power_btn_resources[] = { 86 + static const struct resource msic_power_btn_resources[] = { 87 87 DEFINE_RES_IRQ(0), 88 88 }; 89 89 90 - static struct resource msic_ocd_resources[] = { 90 + static const struct resource msic_ocd_resources[] = { 91 91 DEFINE_RES_IRQ(0), 92 92 }; 93 93
+7 -7
drivers/mfd/intel_soc_pmic_bxtwc.c
··· 200 200 .num_regs = 1, 201 201 }; 202 202 203 - static struct resource gpio_resources[] = { 203 + static const struct resource gpio_resources[] = { 204 204 DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"), 205 205 }; 206 206 207 - static struct resource adc_resources[] = { 207 + static const struct resource adc_resources[] = { 208 208 DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"), 209 209 }; 210 210 211 - static struct resource usbc_resources[] = { 211 + static const struct resource usbc_resources[] = { 212 212 DEFINE_RES_IRQ(BXTWC_USBC_IRQ), 213 213 }; 214 214 215 - static struct resource charger_resources[] = { 215 + static const struct resource charger_resources[] = { 216 216 DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"), 217 217 DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"), 218 218 }; 219 219 220 - static struct resource thermal_resources[] = { 220 + static const struct resource thermal_resources[] = { 221 221 DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ), 222 222 }; 223 223 224 - static struct resource bcu_resources[] = { 224 + static const struct resource bcu_resources[] = { 225 225 DEFINE_RES_IRQ_NAMED(BXTWC_BCU_IRQ, "BCU"), 226 226 }; 227 227 228 - static struct resource tmu_resources[] = { 228 + static const struct resource tmu_resources[] = { 229 229 DEFINE_RES_IRQ_NAMED(BXTWC_TMU_IRQ, "TMU"), 230 230 }; 231 231
+5 -5
drivers/mfd/intel_soc_pmic_chtdc_ti.c
··· 32 32 CHTDC_TI_CCEOCAL = 7, /* battery */ 33 33 }; 34 34 35 - static struct resource power_button_resources[] = { 35 + static const struct resource power_button_resources[] = { 36 36 DEFINE_RES_IRQ(CHTDC_TI_PWRBTN), 37 37 }; 38 38 39 - static struct resource thermal_resources[] = { 39 + static const struct resource thermal_resources[] = { 40 40 DEFINE_RES_IRQ(CHTDC_TI_DIETMPWARN), 41 41 }; 42 42 43 - static struct resource adc_resources[] = { 43 + static const struct resource adc_resources[] = { 44 44 DEFINE_RES_IRQ(CHTDC_TI_ADCCMPL), 45 45 }; 46 46 47 - static struct resource pwrsrc_resources[] = { 47 + static const struct resource pwrsrc_resources[] = { 48 48 DEFINE_RES_IRQ(CHTDC_TI_VBUSDET), 49 49 }; 50 50 51 - static struct resource battery_resources[] = { 51 + static const struct resource battery_resources[] = { 52 52 DEFINE_RES_IRQ(CHTDC_TI_VBATLOW), 53 53 DEFINE_RES_IRQ(CHTDC_TI_CCEOCAL), 54 54 };
+2 -2
drivers/mfd/intel_soc_pmic_chtwc.c
··· 41 41 CHT_WC_CRIT_IRQ = 7, 42 42 }; 43 43 44 - static struct resource cht_wc_pwrsrc_resources[] = { 44 + static const struct resource cht_wc_pwrsrc_resources[] = { 45 45 DEFINE_RES_IRQ(CHT_WC_PWRSRC_IRQ), 46 46 }; 47 47 48 - static struct resource cht_wc_ext_charger_resources[] = { 48 + static const struct resource cht_wc_ext_charger_resources[] = { 49 49 DEFINE_RES_IRQ(CHT_WC_EXT_CHGR_IRQ), 50 50 }; 51 51
+5 -5
drivers/mfd/intel_soc_pmic_crc.c
··· 28 28 #define CRYSTAL_COVE_IRQ_GPIO 5 29 29 #define CRYSTAL_COVE_IRQ_VHDMIOCP 6 30 30 31 - static struct resource gpio_resources[] = { 31 + static const struct resource gpio_resources[] = { 32 32 DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_GPIO, "GPIO"), 33 33 }; 34 34 35 - static struct resource pwrsrc_resources[] = { 35 + static const struct resource pwrsrc_resources[] = { 36 36 DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_PWRSRC, "PWRSRC"), 37 37 }; 38 38 39 - static struct resource adc_resources[] = { 39 + static const struct resource adc_resources[] = { 40 40 DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_ADC, "ADC"), 41 41 }; 42 42 43 - static struct resource thermal_resources[] = { 43 + static const struct resource thermal_resources[] = { 44 44 DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_THRM, "THERMAL"), 45 45 }; 46 46 47 - static struct resource bcu_resources[] = { 47 + static const struct resource bcu_resources[] = { 48 48 DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_BCU, "BCU"), 49 49 }; 50 50