Skip to contentSkip to conversation

mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF

PATCH In review Krzysztof Kozlowski 2 participants 2 messages Sep 25, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF

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

---
 drivers/mmc/host/sdhci-s3c.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/host/sdhci-s3c.c +2 -0
index cb5f87be7535..f48a788a9d3d 100644
@@ -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)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · 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

Applied for next, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/sdhci-s3c.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/host/sdhci-s3c.c +2 -1
index cb5f87be7535..f48a788a9d3d 100644
@@ -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