From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH 2/8] mfd: intel: Constify static struct resource
Date: Tue, 22 Sep 2020 21:26:53 +0200 [thread overview]
Message-ID: <20200922192659.14535-3-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200922192659.14535-1-rikard.falkeborn@gmail.com>
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>
---
drivers/mfd/intel_msic.c | 18 +++++++++---------
drivers/mfd/intel_soc_pmic_bxtwc.c | 14 +++++++-------
drivers/mfd/intel_soc_pmic_chtdc_ti.c | 10 +++++-----
drivers/mfd/intel_soc_pmic_chtwc.c | 4 ++--
drivers/mfd/intel_soc_pmic_crc.c | 10 +++++-----
5 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c
index bb24c2a07900..daa772f8146b 100644
--- a/drivers/mfd/intel_msic.c
+++ b/drivers/mfd/intel_msic.c
@@ -50,23 +50,23 @@ struct intel_msic {
void __iomem *irq_base;
};
-static struct resource msic_touch_resources[] = {
+static const struct resource msic_touch_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_adc_resources[] = {
+static const struct resource msic_adc_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_battery_resources[] = {
+static const struct resource msic_battery_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_gpio_resources[] = {
+static const struct resource msic_gpio_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_audio_resources[] = {
+static const struct resource msic_audio_resources[] = {
DEFINE_RES_IRQ_NAMED(0, "IRQ"),
/*
* We will pass IRQ_BASE to the driver now but this can be removed
@@ -75,19 +75,19 @@ static struct resource msic_audio_resources[] = {
DEFINE_RES_MEM_NAMED(MSIC_IRQ_STATUS_ACCDET, 1, "IRQ_BASE"),
};
-static struct resource msic_hdmi_resources[] = {
+static const struct resource msic_hdmi_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_thermal_resources[] = {
+static const struct resource msic_thermal_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_power_btn_resources[] = {
+static const struct resource msic_power_btn_resources[] = {
DEFINE_RES_IRQ(0),
};
-static struct resource msic_ocd_resources[] = {
+static const struct resource msic_ocd_resources[] = {
DEFINE_RES_IRQ(0),
};
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index eba89780dbe7..47d0d3a69a58 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -200,32 +200,32 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = {
.num_regs = 1,
};
-static struct resource gpio_resources[] = {
+static const struct resource gpio_resources[] = {
DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"),
};
-static struct resource adc_resources[] = {
+static const struct resource adc_resources[] = {
DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"),
};
-static struct resource usbc_resources[] = {
+static const struct resource usbc_resources[] = {
DEFINE_RES_IRQ(BXTWC_USBC_IRQ),
};
-static struct resource charger_resources[] = {
+static const struct resource charger_resources[] = {
DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"),
DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"),
};
-static struct resource thermal_resources[] = {
+static const struct resource thermal_resources[] = {
DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ),
};
-static struct resource bcu_resources[] = {
+static const struct resource bcu_resources[] = {
DEFINE_RES_IRQ_NAMED(BXTWC_BCU_IRQ, "BCU"),
};
-static struct resource tmu_resources[] = {
+static const struct resource tmu_resources[] = {
DEFINE_RES_IRQ_NAMED(BXTWC_TMU_IRQ, "TMU"),
};
diff --git a/drivers/mfd/intel_soc_pmic_chtdc_ti.c b/drivers/mfd/intel_soc_pmic_chtdc_ti.c
index 64b5c3cc30e7..1c7577b881ff 100644
--- a/drivers/mfd/intel_soc_pmic_chtdc_ti.c
+++ b/drivers/mfd/intel_soc_pmic_chtdc_ti.c
@@ -32,23 +32,23 @@ enum {
CHTDC_TI_CCEOCAL = 7, /* battery */
};
-static struct resource power_button_resources[] = {
+static const struct resource power_button_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_PWRBTN),
};
-static struct resource thermal_resources[] = {
+static const struct resource thermal_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_DIETMPWARN),
};
-static struct resource adc_resources[] = {
+static const struct resource adc_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_ADCCMPL),
};
-static struct resource pwrsrc_resources[] = {
+static const struct resource pwrsrc_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_VBUSDET),
};
-static struct resource battery_resources[] = {
+static const struct resource battery_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_VBATLOW),
DEFINE_RES_IRQ(CHTDC_TI_CCEOCAL),
};
diff --git a/drivers/mfd/intel_soc_pmic_chtwc.c b/drivers/mfd/intel_soc_pmic_chtwc.c
index be84bb2aa837..49c5f71664bc 100644
--- a/drivers/mfd/intel_soc_pmic_chtwc.c
+++ b/drivers/mfd/intel_soc_pmic_chtwc.c
@@ -41,11 +41,11 @@ enum {
CHT_WC_CRIT_IRQ = 7,
};
-static struct resource cht_wc_pwrsrc_resources[] = {
+static const struct resource cht_wc_pwrsrc_resources[] = {
DEFINE_RES_IRQ(CHT_WC_PWRSRC_IRQ),
};
-static struct resource cht_wc_ext_charger_resources[] = {
+static const struct resource cht_wc_ext_charger_resources[] = {
DEFINE_RES_IRQ(CHT_WC_EXT_CHGR_IRQ),
};
diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index 429efa1f8e55..38acb20e2d60 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -28,23 +28,23 @@
#define CRYSTAL_COVE_IRQ_GPIO 5
#define CRYSTAL_COVE_IRQ_VHDMIOCP 6
-static struct resource gpio_resources[] = {
+static const struct resource gpio_resources[] = {
DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_GPIO, "GPIO"),
};
-static struct resource pwrsrc_resources[] = {
+static const struct resource pwrsrc_resources[] = {
DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_PWRSRC, "PWRSRC"),
};
-static struct resource adc_resources[] = {
+static const struct resource adc_resources[] = {
DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_ADC, "ADC"),
};
-static struct resource thermal_resources[] = {
+static const struct resource thermal_resources[] = {
DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_THRM, "THERMAL"),
};
-static struct resource bcu_resources[] = {
+static const struct resource bcu_resources[] = {
DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_BCU, "BCU"),
};
--
2.28.0
next prev parent reply other threads:[~2020-09-22 19:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 19:26 [PATCH 0/8] drivers/mfd: " Rikard Falkeborn
2020-09-22 19:26 ` [PATCH 1/8] mfd: da: " Rikard Falkeborn
2020-09-24 8:51 ` Adam Thomson
2020-11-04 10:56 ` Lee Jones
2020-09-22 19:26 ` Rikard Falkeborn [this message]
2020-09-22 21:31 ` [PATCH 2/8] mfd: intel: " Andy Shevchenko
2020-09-22 22:00 ` Rikard Falkeborn
2020-09-23 9:56 ` Andy Shevchenko
2020-11-04 10:56 ` Lee Jones
2020-09-22 19:26 ` [PATCH 3/8] mfd: Constify static struct resource in OMAP2+ drivers Rikard Falkeborn
2020-11-04 10:57 ` Lee Jones
2020-09-22 19:26 ` [PATCH 4/8] mfd: wm: Constify static struct resource Rikard Falkeborn
2020-09-24 15:54 ` Charles Keepax
2020-11-04 10:57 ` Lee Jones
2020-09-22 19:26 ` [PATCH 5/8] mfd: lp8788: " Rikard Falkeborn
2020-11-04 10:58 ` Lee Jones
2020-09-22 19:26 ` [PATCH 6/8] mfd: stmpe: " Rikard Falkeborn
2020-11-04 10:58 ` Lee Jones
2020-09-22 19:26 ` [PATCH 7/8] mfd: sun4i-gpadc: " Rikard Falkeborn
2020-11-04 10:59 ` Lee Jones
2020-09-22 19:26 ` [PATCH 8/8] mfd: " Rikard Falkeborn
2020-11-04 11:04 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200922192659.14535-3-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®