diff mbox series

[v2,15/15] mmc: host: sdhci-iproc: Do not define 'struct acpi_device_id' when !CONFIG_ACPI

Message ID 20200707064701.GC3500@dell (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Lee Jones July 7, 2020, 6:47 a.m. UTC
Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
'struct sdhci_iproc_acpi_ids' becomes defined but unused.

Fixes the following W=1 kernel build warning:

 mmc/host/sdhci-iproc.c:297:36: warning: ‘sdhci_iproc_acpi_ids’ defined but not used [-Wunused-const-variable=]

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>

Comments

Scott Branden July 7, 2020, 3:47 p.m. UTC | #1
thanks

On 2020-07-06 11:47 p.m., Lee Jones wrote:
> Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
> 'struct sdhci_iproc_acpi_ids' becomes defined but unused.
>
> Fixes the following W=1 kernel build warning:
>
>   mmc/host/sdhci-iproc.c:297:36: warning: ‘sdhci_iproc_acpi_ids’ defined but not used [-Wunused-const-variable=]
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Scott Branden <scott.branden@broadcom.com>
>
> diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
> index 225603148d7de..e2d8dfe90077e 100644
> --- a/drivers/mmc/host/sdhci-iproc.c
> +++ b/drivers/mmc/host/sdhci-iproc.c
> @@ -294,12 +294,14 @@ static const struct of_device_id sdhci_iproc_of_match[] = {
>   };
>   MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);
>   
> +#ifdef CONFIG_ACPI
>   static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
>          { .id = "BRCM5871", .driver_data = (kernel_ulong_t)&iproc_cygnus_data },
>          { .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
>          { /* sentinel */ }
>   };
>   MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
> +#endif
>   
>   static int sdhci_iproc_probe(struct platform_device *pdev)
>   {
Ulf Hansson July 8, 2020, 1:20 p.m. UTC | #2
On Tue, 7 Jul 2020 at 08:47, Lee Jones <lee.jones@linaro.org> wrote:
>
> Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
> 'struct sdhci_iproc_acpi_ids' becomes defined but unused.
>
> Fixes the following W=1 kernel build warning:
>
>  mmc/host/sdhci-iproc.c:297:36: warning: ‘sdhci_iproc_acpi_ids’ defined but not used [-Wunused-const-variable=]
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Alright, so I have replaced v1 with this v2 on my next branch, thanks!

Kind regards
Uffe

>
> diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
> index 225603148d7de..e2d8dfe90077e 100644
> --- a/drivers/mmc/host/sdhci-iproc.c
> +++ b/drivers/mmc/host/sdhci-iproc.c
> @@ -294,12 +294,14 @@ static const struct of_device_id sdhci_iproc_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);
>
> +#ifdef CONFIG_ACPI
>  static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
>         { .id = "BRCM5871", .driver_data = (kernel_ulong_t)&iproc_cygnus_data },
>         { .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
>         { /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
> +#endif
>
>  static int sdhci_iproc_probe(struct platform_device *pdev)
>  {
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
index 225603148d7de..e2d8dfe90077e 100644
--- a/drivers/mmc/host/sdhci-iproc.c
+++ b/drivers/mmc/host/sdhci-iproc.c
@@ -294,12 +294,14 @@  static const struct of_device_id sdhci_iproc_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
        { .id = "BRCM5871", .driver_data = (kernel_ulong_t)&iproc_cygnus_data },
        { .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
+#endif
 
 static int sdhci_iproc_probe(struct platform_device *pdev)
 {