Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF
@ 2020-09-25  7:25 Krzysztof Kozlowski
  2020-09-25 11:31 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-25  7:25 UTC (permalink / raw)
  To: Ben Dooks, Jaehoon Chung, Adrian Hunter, Ulf Hansson,
	Nathan Chancellor, Nick Desaulniers, linux-mmc, linux-kernel,
	clang-built-linux
  Cc: Krzysztof Kozlowski

The struct of_device_id is not defined with !CONFIG_OF so its forward
declaration should be hidden to as well.  This should address clang
compile warning:

  drivers/mmc/host/sdhci-s3c.c:464:34: warning: tentative array definition assumed to have one element

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mmc/host/sdhci-s3c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index cb5f87be7535..f48a788a9d3d 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -461,7 +461,9 @@ static int sdhci_s3c_parse_dt(struct device *dev,
 }
 #endif
 
+#ifdef CONFIG_OF
 static const struct of_device_id sdhci_s3c_dt_match[];
+#endif
 
 static inline struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data(
 			struct platform_device *pdev)
-- 
2.17.1


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

* Re: [PATCH] mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF
  2020-09-25  7:25 [PATCH] mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF Krzysztof Kozlowski
@ 2020-09-25 11:31 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2020-09-25 11:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ben Dooks, Jaehoon Chung, Adrian Hunter, Nathan Chancellor,
	Nick Desaulniers, linux-mmc@vger.kernel.org,
	Linux Kernel Mailing List, clang-built-linux

On Fri, 25 Sep 2020 at 09:26, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> The struct of_device_id is not defined with !CONFIG_OF so its forward
> declaration should be hidden to as well.  This should address clang
> compile warning:
>
>   drivers/mmc/host/sdhci-s3c.c:464:34: warning: tentative array definition assumed to have one element
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-s3c.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index cb5f87be7535..f48a788a9d3d 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -461,7 +461,9 @@ static int sdhci_s3c_parse_dt(struct device *dev,
>  }
>  #endif
>
> +#ifdef CONFIG_OF
>  static const struct of_device_id sdhci_s3c_dt_match[];
> +#endif
>
>  static inline struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data(
>                         struct platform_device *pdev)
> --
> 2.17.1
>

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

end of thread, other threads:[~2020-09-25 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-25  7:25 [PATCH] mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF Krzysztof Kozlowski
2020-09-25 11:31 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox