Skip to contentSkip to conversation

mmc: fix mmc_{un,}register_pm_notifier prototypes

PATCH In review Arnd Bergmann 2 participants 2 messages Nov 20, 2015 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fix mmc_{un,}register_pm_notifier prototypes

The mmc pm notifiers were recently reworked, but the new code produces a lot of warnings when CONFIG_PM_SLEEP is disabled:

In file included from ../drivers/mmc/core/sdio_bus.c:27:0:
drivers/mmc/core/core.h:97:13: warning: 'mmc_register_pm_notifier' defined but not used [-Wunused-function]

The obvious solution is to add the 'inline' keyword at the function definition, as it should be for any function defined in a header file.

Fixes 0e40be7c20e0 ("mmc: core: Refactor code to register the MMC PM notifier")
drivers/mmc/core/core.h +2 -2
index bd00ac2cdc1b..0fa86a2afc26 100644
@@ -94,8 +94,8 @@ int mmc_hs400_to_hs200(struct mmc_card *card);
 void mmc_register_pm_notifier(struct mmc_host *host);
 void mmc_unregister_pm_notifier(struct mmc_host *host);
 #else
-static void mmc_register_pm_notifier(struct mmc_host *host) { }
-static void mmc_unregister_pm_notifier(struct mmc_host *host) { }
+static inline void mmc_register_pm_notifier(struct mmc_host *host) { }
+static inline void mmc_unregister_pm_notifier(struct mmc_host *host) { }
 #endif
 
 #endif
#1 lore raw
Quoted 6 lines · Arnd Bergmann

The mmc pm notifiers were recently reworked, but the new code produces a lot of warnings when CONFIG_PM_SLEEP is disabled:

In file included from ../drivers/mmc/core/sdio_bus.c:27:0:
drivers/mmc/core/core.h:97:13: warning: 'mmc_register_pm_notifier' defined but not used [-Wunused-function]

Quoted 6 lines

The obvious solution is to add the 'inline' keyword at the function definition, as it should be for any function defined in a header file.

Fixes 0e40be7c20e0 ("mmc: core: Refactor code to register the MMC PM notifier")

My bad. How could I even *not* notice those warnings.

Thanks for helping out Arnd, patch applied!

Kind regards
Uffe

Quoted 17 lines
drivers/mmc/core/core.h +2 -2
index bd00ac2cdc1b..0fa86a2afc26 100644
@@ -94,8 +94,8 @@ int mmc_hs400_to_hs200(struct mmc_card *card);
 void mmc_register_pm_notifier(struct mmc_host *host);
 void mmc_unregister_pm_notifier(struct mmc_host *host);
 #else
-static void mmc_register_pm_notifier(struct mmc_host *host) { }
-static void mmc_unregister_pm_notifier(struct mmc_host *host) { }
+static inline void mmc_register_pm_notifier(struct mmc_host *host) { }
+static inline void mmc_unregister_pm_notifier(struct mmc_host *host) { }
 #endif
 
 #endif