linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures
@ 2017-08-07  9:50 Julia Lawall
  2017-08-07  9:50 ` [PATCH 1/5] drivers/mmc/host: constify sdhci_pltfm_data structures Julia Lawall
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Julia Lawall @ 2017-08-07  9:50 UTC (permalink / raw)
  Cc: bhumirks, kernel-janitors, linux-kernel, linux-mmc, Ulf Hansson,
	Adrian Hunter, linux-arm-kernel, bcm-kernel-feedback-list

The sdhci_pltfm_data structures are only passed as the second
argument of sdhci_pltfm_init, which is const, while the sdhci_ops
structures are only stored in the ops field of a sdhci_pltfm_data
structure, which is also const.  Thus both kinds of structures can
be const as well.

Done with the help of Coccinelle.

---

 drivers/mmc/host/sdhci-bcm-kona.c  |    4 ++--
 drivers/mmc/host/sdhci-brcmstb.c   |    2 +-
 drivers/mmc/host/sdhci-of-arasan.c |    4 ++--
 drivers/mmc/host/sdhci-pic32.c     |    2 +-
 drivers/mmc/host/sdhci-pxav3.c     |    2 +-
 drivers/mmc/host/sdhci-sirf.c      |    4 ++--
 6 files changed, 9 insertions(+), 9 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] drivers/mmc/host: constify sdhci_pltfm_data structures
  2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
@ 2017-08-07  9:50 ` Julia Lawall
  2017-08-07  9:50 ` [PATCH 2/5] mmc: sdhci-bcm-kona: constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2017-08-07  9:50 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: bhumirks, kernel-janitors, Ulf Hansson, linux-mmc, linux-kernel

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, so the sdhci_pltfm_data structure can
be const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/sdhci-pic32.c |    2 +-
 drivers/mmc/host/sdhci-pxav3.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pic32.c b/drivers/mmc/host/sdhci-pic32.c
index 72c13b6..a6caa49 100644
--- a/drivers/mmc/host/sdhci-pic32.c
+++ b/drivers/mmc/host/sdhci-pic32.c
@@ -97,7 +97,7 @@ static unsigned int pic32_sdhci_get_ro(struct sdhci_host *host)
 	.get_ro = pic32_sdhci_get_ro,
 };
 
-static struct sdhci_pltfm_data sdhci_pic32_pdata = {
+static const struct sdhci_pltfm_data sdhci_pic32_pdata = {
 	.ops = &pic32_sdhci_ops,
 	.quirks = SDHCI_QUIRK_NO_HISPD_BIT,
 	.quirks2 = SDHCI_QUIRK2_NO_1_8_V,
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index f953f35..a344341 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -337,7 +337,7 @@ static void pxav3_set_power(struct sdhci_host *host, unsigned char mode,
 	.set_uhs_signaling = pxav3_set_uhs_signaling,
 };
 
-static struct sdhci_pltfm_data sdhci_pxav3_pdata = {
+static const struct sdhci_pltfm_data sdhci_pxav3_pdata = {
 	.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
 		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
 		| SDHCI_QUIRK_32BIT_ADMA_SIZE

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/5] mmc: sdhci-bcm-kona: constify sdhci_pltfm_data and sdhci_ops structures
  2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
  2017-08-07  9:50 ` [PATCH 1/5] drivers/mmc/host: constify sdhci_pltfm_data structures Julia Lawall
@ 2017-08-07  9:50 ` Julia Lawall
  2017-08-07  9:50 ` [PATCH 3/5] mmc: sdhci-sirf: " Julia Lawall
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2017-08-07  9:50 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: bhumirks, kernel-janitors, Ulf Hansson, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, linux-mmc,
	linux-kernel

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, while the sdhci_ops structure
is only stored in the ops field of a sdhci_pltfm_data structure,
which is also const.  Thus both kinds of structures can be const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/sdhci-bcm-kona.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index 51dd2fd..11ca95c 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -186,7 +186,7 @@ static void sdhci_bcm_kona_init_74_clocks(struct sdhci_host *host,
 		udelay(740);
 }
 
-static struct sdhci_ops sdhci_bcm_kona_ops = {
+static const struct sdhci_ops sdhci_bcm_kona_ops = {
 	.set_clock = sdhci_set_clock,
 	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
 	.get_timeout_clock = sdhci_pltfm_clk_get_max_clock,
@@ -197,7 +197,7 @@ static void sdhci_bcm_kona_init_74_clocks(struct sdhci_host *host,
 	.card_event = sdhci_bcm_kona_card_event,
 };
 
-static struct sdhci_pltfm_data sdhci_pltfm_data_kona = {
+static const struct sdhci_pltfm_data sdhci_pltfm_data_kona = {
 	.ops    = &sdhci_bcm_kona_ops,
 	.quirks = SDHCI_QUIRK_NO_CARD_NO_RESET |
 		SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_32BIT_DMA_ADDR |

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/5] mmc: sdhci-sirf: constify sdhci_pltfm_data and sdhci_ops structures
  2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
  2017-08-07  9:50 ` [PATCH 1/5] drivers/mmc/host: constify sdhci_pltfm_data structures Julia Lawall
  2017-08-07  9:50 ` [PATCH 2/5] mmc: sdhci-bcm-kona: constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
@ 2017-08-07  9:50 ` Julia Lawall
  2017-08-07  9:50 ` [PATCH 4/5] mmc: sdhci-of-arasan: " Julia Lawall
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2017-08-07  9:50 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: bhumirks, kernel-janitors, Ulf Hansson, Barry Song, linux-mmc,
	linux-arm-kernel, linux-kernel

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, while the sdhci_ops structure
is only stored in the ops field of a sdhci_pltfm_data structure,
which is also const.  Thus both kinds of structures can be const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/sdhci-sirf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
index c251c6c..556b0cf 100644
--- a/drivers/mmc/host/sdhci-sirf.c
+++ b/drivers/mmc/host/sdhci-sirf.c
@@ -146,7 +146,7 @@ static int sdhci_sirf_execute_tuning(struct sdhci_host *host, u32 opcode)
 	return rc;
 }
 
-static struct sdhci_ops sdhci_sirf_ops = {
+static const struct sdhci_ops sdhci_sirf_ops = {
 	.read_l = sdhci_sirf_readl_le,
 	.read_w = sdhci_sirf_readw_le,
 	.platform_execute_tuning = sdhci_sirf_execute_tuning,
@@ -157,7 +157,7 @@ static int sdhci_sirf_execute_tuning(struct sdhci_host *host, u32 opcode)
 	.set_uhs_signaling = sdhci_set_uhs_signaling,
 };
 
-static struct sdhci_pltfm_data sdhci_sirf_pdata = {
+static const struct sdhci_pltfm_data sdhci_sirf_pdata = {
 	.ops = &sdhci_sirf_ops,
 	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
 		SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] mmc: sdhci-of-arasan: constify sdhci_pltfm_data and sdhci_ops structures
  2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
                   ` (2 preceding siblings ...)
  2017-08-07  9:50 ` [PATCH 3/5] mmc: sdhci-sirf: " Julia Lawall
@ 2017-08-07  9:50 ` Julia Lawall
  2017-08-07 12:50   ` Michal Simek
  2017-08-07  9:50 ` [PATCH 5/5] mmc: sdhci-brcmstb: constify sdhci_pltfm_data structures Julia Lawall
  2017-08-08 10:38 ` [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Ulf Hansson
  5 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2017-08-07  9:50 UTC (permalink / raw)
  To: Michal Simek
  Cc: bhumirks, kernel-janitors, Sören Brinkmann, Adrian Hunter,
	Ulf Hansson, linux-arm-kernel, linux-mmc, linux-kernel

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, while the sdhci_ops structure
is only stored in the ops field of a sdhci_pltfm_data structure,
which is also const.  Thus both kinds of structures can be const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/sdhci-of-arasan.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 528a5d2..0720ea7 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -262,7 +262,7 @@ static int sdhci_arasan_voltage_switch(struct mmc_host *mmc,
 	return -EINVAL;
 }
 
-static struct sdhci_ops sdhci_arasan_ops = {
+static const struct sdhci_ops sdhci_arasan_ops = {
 	.set_clock = sdhci_arasan_set_clock,
 	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
 	.get_timeout_clock = sdhci_pltfm_clk_get_max_clock,
@@ -271,7 +271,7 @@ static int sdhci_arasan_voltage_switch(struct mmc_host *mmc,
 	.set_uhs_signaling = sdhci_set_uhs_signaling,
 };
 
-static struct sdhci_pltfm_data sdhci_arasan_pdata = {
+static const struct sdhci_pltfm_data sdhci_arasan_pdata = {
 	.ops = &sdhci_arasan_ops,
 	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] mmc: sdhci-brcmstb: constify sdhci_pltfm_data structures
  2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
                   ` (3 preceding siblings ...)
  2017-08-07  9:50 ` [PATCH 4/5] mmc: sdhci-of-arasan: " Julia Lawall
@ 2017-08-07  9:50 ` Julia Lawall
  2017-08-08 10:38 ` [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Ulf Hansson
  5 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2017-08-07  9:50 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: bhumirks, kernel-janitors, Al Cooper, Ulf Hansson, Brian Norris,
	Gregory Fong, Florian Fainelli, bcm-kernel-feedback-list,
	linux-mmc, linux-arm-kernel, linux-kernel

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, so the sdhci_pltfm_data structure
can be const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mmc/host/sdhci-brcmstb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
index e2f6383..3a64c13 100644
--- a/drivers/mmc/host/sdhci-brcmstb.c
+++ b/drivers/mmc/host/sdhci-brcmstb.c
@@ -63,7 +63,7 @@ static SIMPLE_DEV_PM_OPS(sdhci_brcmstb_pmops, sdhci_brcmstb_suspend,
 	.set_uhs_signaling = sdhci_set_uhs_signaling,
 };
 
-static struct sdhci_pltfm_data sdhci_brcmstb_pdata = {
+static const struct sdhci_pltfm_data sdhci_brcmstb_pdata = {
 	.ops = &sdhci_brcmstb_ops,
 };
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/5] mmc: sdhci-of-arasan: constify sdhci_pltfm_data and sdhci_ops structures
  2017-08-07  9:50 ` [PATCH 4/5] mmc: sdhci-of-arasan: " Julia Lawall
@ 2017-08-07 12:50   ` Michal Simek
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Simek @ 2017-08-07 12:50 UTC (permalink / raw)
  To: Julia Lawall, Michal Simek
  Cc: bhumirks, kernel-janitors, Sören Brinkmann, Adrian Hunter,
	Ulf Hansson, linux-arm-kernel, linux-mmc, linux-kernel

On 7.8.2017 11:50, Julia Lawall wrote:
> The sdhci_pltfm_data structure is only passed as the second argument
> of sdhci_pltfm_init, which is const, while the sdhci_ops structure
> is only stored in the ops field of a sdhci_pltfm_data structure,
> which is also const.  Thus both kinds of structures can be const as
> well.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/mmc/host/sdhci-of-arasan.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> index 528a5d2..0720ea7 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -262,7 +262,7 @@ static int sdhci_arasan_voltage_switch(struct mmc_host *mmc,
>  	return -EINVAL;
>  }
>  
> -static struct sdhci_ops sdhci_arasan_ops = {
> +static const struct sdhci_ops sdhci_arasan_ops = {
>  	.set_clock = sdhci_arasan_set_clock,
>  	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
>  	.get_timeout_clock = sdhci_pltfm_clk_get_max_clock,
> @@ -271,7 +271,7 @@ static int sdhci_arasan_voltage_switch(struct mmc_host *mmc,
>  	.set_uhs_signaling = sdhci_set_uhs_signaling,
>  };
>  
> -static struct sdhci_pltfm_data sdhci_arasan_pdata = {
> +static const struct sdhci_pltfm_data sdhci_arasan_pdata = {
>  	.ops = &sdhci_arasan_ops,
>  	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
>  	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
> 

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures
  2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
                   ` (4 preceding siblings ...)
  2017-08-07  9:50 ` [PATCH 5/5] mmc: sdhci-brcmstb: constify sdhci_pltfm_data structures Julia Lawall
@ 2017-08-08 10:38 ` Ulf Hansson
  5 siblings, 0 replies; 8+ messages in thread
From: Ulf Hansson @ 2017-08-08 10:38 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Bhumika Goyal, kernel-janitors, linux-kernel, linux-mmc,
	Adrian Hunter, linux-arm-kernel, BCM Kernel Feedback

On 7 August 2017 at 11:50, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> The sdhci_pltfm_data structures are only passed as the second
> argument of sdhci_pltfm_init, which is const, while the sdhci_ops
> structures are only stored in the ops field of a sdhci_pltfm_data
> structure, which is also const.  Thus both kinds of structures can
> be const as well.
>
> Done with the help of Coccinelle.
>
> ---
>
>  drivers/mmc/host/sdhci-bcm-kona.c  |    4 ++--
>  drivers/mmc/host/sdhci-brcmstb.c   |    2 +-
>  drivers/mmc/host/sdhci-of-arasan.c |    4 ++--
>  drivers/mmc/host/sdhci-pic32.c     |    2 +-
>  drivers/mmc/host/sdhci-pxav3.c     |    2 +-
>  drivers/mmc/host/sdhci-sirf.c      |    4 ++--
>  6 files changed, 9 insertions(+), 9 deletions(-)

Thanks, applied for next!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-08 10:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07  9:50 [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
2017-08-07  9:50 ` [PATCH 1/5] drivers/mmc/host: constify sdhci_pltfm_data structures Julia Lawall
2017-08-07  9:50 ` [PATCH 2/5] mmc: sdhci-bcm-kona: constify sdhci_pltfm_data and sdhci_ops structures Julia Lawall
2017-08-07  9:50 ` [PATCH 3/5] mmc: sdhci-sirf: " Julia Lawall
2017-08-07  9:50 ` [PATCH 4/5] mmc: sdhci-of-arasan: " Julia Lawall
2017-08-07 12:50   ` Michal Simek
2017-08-07  9:50 ` [PATCH 5/5] mmc: sdhci-brcmstb: constify sdhci_pltfm_data structures Julia Lawall
2017-08-08 10:38 ` [PATCH 0/5] constify sdhci_pltfm_data and sdhci_ops structures Ulf Hansson

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).