Skip to contentSkip to conversation

drivers: mmc: Mark the function sdhci_disable_irq_wakeups() as static in sdhci.c

PATCH In review Rashika Kheria 2 participants 3 messages Dec 14, 2013 – Dec 15, 2013

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

PATCH 1/1 drivers: mmc: Mark the function sdhci_disable_irq_wakeups() as static in sdhci.c

This patch marks the function sdhci_disable_irq_wakeups() as static in host/sdhci.c because it is not used outside this file.

Thus, it also eliminates the following warning in host/sdhci.c:
drivers/mmc/host/sdhci.c:2553:6: warning: no previous prototype for ‘sdhci_disable_irq_wakeups’ [-Wmissing-prototypes]

---
 drivers/mmc/host/sdhci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +1 -1
index bd8a098..8de50e8 100644
@@ -2550,7 +2550,7 @@ void sdhci_enable_irq_wakeups(struct sdhci_host *host)
 }
 EXPORT_SYMBOL_GPL(sdhci_enable_irq_wakeups);
 
-void sdhci_disable_irq_wakeups(struct sdhci_host *host)
+static void sdhci_disable_irq_wakeups(struct sdhci_host *host)
 {
 	u8 val;
 	u8 mask = SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Rashika Kheria

This patch marks the function sdhci_disable_irq_wakeups() as static in host/sdhci.c because it is not used outside this file.

Thus, it also eliminates the following warning in host/sdhci.c:
drivers/mmc/host/sdhci.c:2553:6: warning: no previous prototype for ‘sdhci_disable_irq_wakeups’ [-Wmissing-prototypes]

This function has an EXPORT_SYMBOL_GPL, making it available for use elsewhere in the kernel. However, nothing in the kernel actually *calls* this function, other than the one internal call in sdhci_resume_host. Thus, I'd suggest making this function static as you have in this patch, and additionally deleting the EXPORT_SYMBOL_GPL for it.

With that change:

Quoted 19 lines
 drivers/mmc/host/sdhci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +1 -1
index bd8a098..8de50e8 100644
@@ -2550,7 +2550,7 @@ void sdhci_enable_irq_wakeups(struct sdhci_host *host)
 }
 EXPORT_SYMBOL_GPL(sdhci_enable_irq_wakeups);
 
-void sdhci_disable_irq_wakeups(struct sdhci_host *host)
+static void sdhci_disable_irq_wakeups(struct sdhci_host *host)
 {
 	u8 val;
 	u8 mask = SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 1/1 drivers: mmc: Mark the function sdhci_disable_irq_wakeups() as static in sdhci.c

In reply to Rashika Kheria

This patch marks the function sdhci_disable_irq_wakeups() as static in host/sdhci.c because it is not used outside this file. It also removes the EXPORT_SYMBOL_GPL because no other file in kernel uses this function.

Thus, it also eliminates the following warning in host/sdhci.c:
drivers/mmc/host/sdhci.c:2553:6: warning: no previous prototype for ‘sdhci_disable_irq_wakeups’ [-Wmissing-prototypes]

---
 drivers/mmc/host/sdhci.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +1 -2
index bd8a098..5fcf200 100644
@@ -2550,7 +2550,7 @@ void sdhci_enable_irq_wakeups(struct sdhci_host *host)
 }
 EXPORT_SYMBOL_GPL(sdhci_enable_irq_wakeups);
 
-void sdhci_disable_irq_wakeups(struct sdhci_host *host)
+static void sdhci_disable_irq_wakeups(struct sdhci_host *host)
 {
 	u8 val;
 	u8 mask = SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE
@@ -2560,7 +2560,6 @@ void sdhci_disable_irq_wakeups(struct sdhci_host *host)
 	val &= ~mask;
 	sdhci_writeb(host, val, SDHCI_WAKE_UP_CONTROL);
 }
-EXPORT_SYMBOL_GPL(sdhci_disable_irq_wakeups);
 
 int sdhci_suspend_host(struct sdhci_host *host)
 {
Signature · 1 line
1.7.9.5