linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org
Subject: [PATCH 3/8] mfd: Constify static struct resource in OMAP2+ drivers
Date: Tue, 22 Sep 2020 21:26:54 +0200	[thread overview]
Message-ID: <20200922192659.14535-4-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/tps65217.c | 4 ++--
 drivers/mfd/tps65910.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 2d9c282ec917..8027b0a9e14f 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -33,12 +33,12 @@
 #include <linux/mfd/core.h>
 #include <linux/mfd/tps65217.h>
 
-static struct resource charger_resources[] = {
+static const struct resource charger_resources[] = {
 	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_AC, "AC"),
 	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_USB, "USB"),
 };
 
-static struct resource pb_resources[] = {
+static const struct resource pb_resources[] = {
 	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_PB, "PB"),
 };
 
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 11959021b50a..a6c28df7aa38 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -21,7 +21,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 
-static struct resource rtc_resources[] = {
+static const struct resource rtc_resources[] = {
 	{
 		.start  = TPS65910_IRQ_RTC_ALARM,
 		.end    = TPS65910_IRQ_RTC_ALARM,
-- 
2.28.0


  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: Constify static struct resource 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 ` [PATCH 2/8] mfd: intel: " Rikard Falkeborn
2020-09-22 21:31   ` 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 ` Rikard Falkeborn [this message]
2020-11-04 10:57   ` [PATCH 3/8] mfd: Constify static struct resource in OMAP2+ drivers 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-4-rikard.falkeborn@gmail.com \
    --to=rikard.falkeborn@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).