mbox series

[v2,0/5] mmc: Constify struct sdhci_ops

Message ID 20240414-mmc-const-sdhci-ops-v2-0-262f81faadac@kernel.org
Headers show
Series mmc: Constify struct sdhci_ops | expand

Message

Krzysztof Kozlowski April 14, 2024, 2:07 p.m. UTC
Hi,

Changes in v2:
- Patch 5 - sdhci-s3c: add __maybe_unused, reported by kernel test
  robot.
- Link to v1: https://lore.kernel.org/r/20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org

The local struct sdhci_ops can be made const for code safety.
No dependencies.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (5):
      mmc: sdhci-esdhc-mcf: Constify struct sdhci_ops
      mmc: sdhci-omap: Constify struct sdhci_ops
      mmc: sdhci-sprd: Constify struct sdhci_ops
      mmc: sdhci_am654: Constify struct sdhci_ops
      mmc: sdhci-s3c: Choose sdhci_ops based on variant

 drivers/mmc/host/sdhci-esdhc-mcf.c |  2 +-
 drivers/mmc/host/sdhci-omap.c      |  2 +-
 drivers/mmc/host/sdhci-s3c.c       | 31 +++++++++++++++++--------------
 drivers/mmc/host/sdhci-sprd.c      |  2 +-
 drivers/mmc/host/sdhci_am654.c     |  6 +++---
 5 files changed, 23 insertions(+), 20 deletions(-)
---
base-commit: f67245b3062cdc225b37003085bdb2916e1670b6
change-id: 20240414-mmc-const-sdhci-ops-c85762883004

Best regards,

Comments

Baolin Wang April 15, 2024, 1:45 a.m. UTC | #1
On 2024/4/14 22:07, Krzysztof Kozlowski wrote:
> The local struct sdhci_ops can be made const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

LGTM. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   drivers/mmc/host/sdhci-sprd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index 685b1c648901..8776f4287119 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -439,7 +439,7 @@ static void sdhci_sprd_set_power(struct sdhci_host *host, unsigned char mode,
>   	}
>   }
>   
> -static struct sdhci_ops sdhci_sprd_ops = {
> +static const struct sdhci_ops sdhci_sprd_ops = {
>   	.read_l = sdhci_sprd_readl,
>   	.write_l = sdhci_sprd_writel,
>   	.write_w = sdhci_sprd_writew,
>
Ulf Hansson April 25, 2024, 4:21 p.m. UTC | #2
On Sun, 14 Apr 2024 at 16:07, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Hi,
>
> Changes in v2:
> - Patch 5 - sdhci-s3c: add __maybe_unused, reported by kernel test
>   robot.
> - Link to v1: https://lore.kernel.org/r/20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org
>
> The local struct sdhci_ops can be made const for code safety.
> No dependencies.
>
> Best regards,
> Krzysztof
>
> ---
> Krzysztof Kozlowski (5):
>       mmc: sdhci-esdhc-mcf: Constify struct sdhci_ops
>       mmc: sdhci-omap: Constify struct sdhci_ops
>       mmc: sdhci-sprd: Constify struct sdhci_ops
>       mmc: sdhci_am654: Constify struct sdhci_ops
>       mmc: sdhci-s3c: Choose sdhci_ops based on variant
>
>  drivers/mmc/host/sdhci-esdhc-mcf.c |  2 +-
>  drivers/mmc/host/sdhci-omap.c      |  2 +-
>  drivers/mmc/host/sdhci-s3c.c       | 31 +++++++++++++++++--------------
>  drivers/mmc/host/sdhci-sprd.c      |  2 +-
>  drivers/mmc/host/sdhci_am654.c     |  6 +++---
>  5 files changed, 23 insertions(+), 20 deletions(-)
> ---

Applied for next, thanks!

Kind regards
Uffe