mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>,
	Ulf Hansson <ulfh@kernel.org>, Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Hu Ziji <huziji@marvell.com>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mmc: sdhci: Use named initializers for acpi_device_id
Date: Fri, 6 Nov 2026 19:36:24 +0200	[thread overview]
Message-ID: <2ba59618-e537-4593-a840-744b2f26eb4b@intel.com> (raw)
In-Reply-To: <20261106-acpi-mmc-v1-1-00934babd69e@thegoodpenguin.co.uk>

On 06/11/2026 17:55, Pawel Zalewski wrote:
> Use a designated initializer for the acpi_device_id fields which makes the
> code more readable and consistent with how lists are initialized in the
> rest of the kernel code base.

Why is there a different explanation above the "---" than below "---" ?

> 
> Unify the list terminator to have a single space between the brackets and
> no trailing comma.

Why?

> 
> Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
> ---
> This series is converting lists that contain the acpi_device_id struct,
> which is defined in the include/linux/device-id/acpi.h to make use of named
> initializers (which they do not use currently). This work is part of the on
> going effort in the kernel associated with device-ids [1]
> 
> The plan is to convert acpi_device_id::driver_data to have an anonymous
> union, similarly to what was introduced for PCI and I2C device ID tables.
> The goal is to increase type-safety (most of the existing casts are gone),
> to improve readability and to make use intent a bit more clear:
> 
> ```
> union {
> 	kernel_ulong_t driver_data;
> 	const void *driver_data_ptr;
> }
> ```
> 
> But for that to work all lists containing the structs need to use named
> initializers first to avoid triggering -Wmissing-braces. I already have
> patches that implement this and touching a lot of kernel subsystmes that
> use the acpi_device_id struct and that list keeps on growing. Therefore,
> I have decided to split the series per every subsystem into:
> - pre-clean-ups that convert the lists to use named initializers
>   (which is this series)
> - actual implementations that make some of the modules use the new
>   driver_data_ptr member
> 
> That way the task can be fragmented into manageable and independent chunks
> of work and makes this effort easier to review.
> 
> [1] https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com/
> ---
>  drivers/mmc/host/sdhci-acpi.c       | 30 +++++++++++++++---------------
>  drivers/mmc/host/sdhci-iproc.c      |  2 +-
>  drivers/mmc/host/sdhci-of-dwcmshc.c |  2 +-
>  drivers/mmc/host/sdhci-xenon.c      |  8 ++++----
>  drivers/mmc/host/sdhci_f_sdh30.c    |  4 ++--
>  5 files changed, 23 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 84c7054607fc..e97c33614fd1 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -704,21 +704,21 @@ static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
>  };
>  
>  static const struct acpi_device_id sdhci_acpi_ids[] = {
> -	{ "80865ACA" },
> -	{ "80865ACC" },
> -	{ "80865AD0" },
> -	{ "80860F14" },
> -	{ "80860F16" },
> -	{ "INT33BB"  },
> -	{ "INT33C6"  },
> -	{ "INT3436"  },
> -	{ "INT344D"  },
> -	{ "PNP0D40"  },
> -	{ "QCOM8051" },
> -	{ "QCOM8052" },
> -	{ "AMDI0040" },
> -	{ "AMDI0041" },
> -	{ },
> +	{ .id = "80865ACA" },
> +	{ .id = "80865ACC" },
> +	{ .id = "80865AD0" },
> +	{ .id = "80860F14" },
> +	{ .id = "80860F16" },
> +	{ .id = "INT33BB" },
> +	{ .id = "INT33C6" },
> +	{ .id = "INT3436" },
> +	{ .id = "INT344D" },
> +	{ .id = "PNP0D40" },
> +	{ .id = "QCOM8051" },
> +	{ .id = "QCOM8052" },
> +	{ .id = "AMDI0040" },
> +	{ .id = "AMDI0041" },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);
>  
> diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
> index 35ef5c5f5146..db5bed2397f6 100644
> --- a/drivers/mmc/host/sdhci-iproc.c
> +++ b/drivers/mmc/host/sdhci-iproc.c
> @@ -350,7 +350,7 @@ static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
>  	{ .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
>  	{ .id = "BCM2847",  .driver_data = (kernel_ulong_t)&bcm_arasan_data },
>  	{ .id = "BRCME88C", .driver_data = (kernel_ulong_t)&bcm2711_data },
> -	{ /* sentinel */ }
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
>  #endif
> diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
> index 09702022e708..113a9399d7dc 100644
> --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
> @@ -2400,7 +2400,7 @@ static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = {
>  		.id = "MLNXBF30",
>  		.driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata,
>  	},
> -	{}
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_dwcmshc_acpi_ids);
>  #endif
> diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
> index 046e8100dd08..2e4926e722f3 100644
> --- a/drivers/mmc/host/sdhci-xenon.c
> +++ b/drivers/mmc/host/sdhci-xenon.c
> @@ -700,10 +700,10 @@ MODULE_DEVICE_TABLE(of, sdhci_xenon_dt_ids);
>  
>  #ifdef CONFIG_ACPI
>  static const struct acpi_device_id sdhci_xenon_acpi_ids[] = {
> -	{ .id = "MRVL0002", XENON_AP806},
> -	{ .id = "MRVL0003", XENON_AP807},
> -	{ .id = "MRVL0004", XENON_CP110},
> -	{}
> +	{ .id = "MRVL0002", .driver_data = XENON_AP806 },
> +	{ .id = "MRVL0003", .driver_data = XENON_AP807 },
> +	{ .id = "MRVL0004", .driver_data = XENON_CP110 },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_xenon_acpi_ids);
>  #endif
> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
> index e9b934e159ad..f3d0a50d1a6f 100644
> --- a/drivers/mmc/host/sdhci_f_sdh30.c
> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
> @@ -227,8 +227,8 @@ MODULE_DEVICE_TABLE(of, f_sdh30_dt_ids);
>  
>  #ifdef CONFIG_ACPI
>  static const struct acpi_device_id f_sdh30_acpi_ids[] = {
> -	{ "SCX0002" },
> -	{ /* sentinel */ }
> +	{ .id = "SCX0002" },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, f_sdh30_acpi_ids);
>  #endif
> 
> ---
> base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1
> change-id: 20261102-acpi-mmc-7bbb96467dd8
> 
> Best regards,
> --  
> Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
> 


      reply	other threads:[~2026-11-06 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 15:55 Pawel Zalewski
2026-11-06 17:36 ` Adrian Hunter [this message]

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=2ba59618-e537-4593-a840-744b2f26eb4b@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=huziji@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=pzalewski@thegoodpenguin.co.uk \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=ulfh@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®