diff mbox series

watchdog: fix compile time error of pretimeout governors

Message ID 20190311235425.1748-1-vz@mleia.com (mailing list archive)
State Accepted
Headers show
Series watchdog: fix compile time error of pretimeout governors | expand

Commit Message

Vladimir Zapolskiy March 11, 2019, 11:54 p.m. UTC
CONFIG_WATCHDOG_PRETIMEOUT_GOV build symbol adds watchdog_pretimeout.o
object to watchdog.o, the latter is compiled only if CONFIG_WATCHDOG_CORE
is selected, so it rightfully makes sense to add it as a dependency.

The change fixes the next compilation errors, if CONFIG_WATCHDOG_CORE=n
and CONFIG_WATCHDOG_PRETIMEOUT_GOV=y are selected:

  drivers/watchdog/pretimeout_noop.o: In function `watchdog_gov_noop_register':
  drivers/watchdog/pretimeout_noop.c:35: undefined reference to `watchdog_register_governor'
  drivers/watchdog/pretimeout_noop.o: In function `watchdog_gov_noop_unregister':
  drivers/watchdog/pretimeout_noop.c:40: undefined reference to `watchdog_unregister_governor'

  drivers/watchdog/pretimeout_panic.o: In function `watchdog_gov_panic_register':
  drivers/watchdog/pretimeout_panic.c:35: undefined reference to `watchdog_register_governor'
  drivers/watchdog/pretimeout_panic.o: In function `watchdog_gov_panic_unregister':
  drivers/watchdog/pretimeout_panic.c:40: undefined reference to `watchdog_unregister_governor'

Reported-by: Kuo, Hsuan-Chi <hckuo2@illinois.edu>
Fixes: ff84136cb6a4 ("watchdog: add watchdog pretimeout governor framework")
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 drivers/watchdog/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck March 12, 2019, 12:07 a.m. UTC | #1
On 3/11/19 4:54 PM, Vladimir Zapolskiy wrote:
> CONFIG_WATCHDOG_PRETIMEOUT_GOV build symbol adds watchdog_pretimeout.o
> object to watchdog.o, the latter is compiled only if CONFIG_WATCHDOG_CORE
> is selected, so it rightfully makes sense to add it as a dependency.
> 
> The change fixes the next compilation errors, if CONFIG_WATCHDOG_CORE=n
> and CONFIG_WATCHDOG_PRETIMEOUT_GOV=y are selected:
> 
>    drivers/watchdog/pretimeout_noop.o: In function `watchdog_gov_noop_register':
>    drivers/watchdog/pretimeout_noop.c:35: undefined reference to `watchdog_register_governor'
>    drivers/watchdog/pretimeout_noop.o: In function `watchdog_gov_noop_unregister':
>    drivers/watchdog/pretimeout_noop.c:40: undefined reference to `watchdog_unregister_governor'
> 
>    drivers/watchdog/pretimeout_panic.o: In function `watchdog_gov_panic_register':
>    drivers/watchdog/pretimeout_panic.c:35: undefined reference to `watchdog_register_governor'
>    drivers/watchdog/pretimeout_panic.o: In function `watchdog_gov_panic_unregister':
>    drivers/watchdog/pretimeout_panic.c:40: undefined reference to `watchdog_unregister_governor'
> 
> Reported-by: Kuo, Hsuan-Chi <hckuo2@illinois.edu>
> Fixes: ff84136cb6a4 ("watchdog: add watchdog pretimeout governor framework")
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 242eea859637..fa325b49672e 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -2028,6 +2028,7 @@ comment "Watchdog Pretimeout Governors"
>   
>   config WATCHDOG_PRETIMEOUT_GOV
>   	bool "Enable watchdog pretimeout governors"
> +	depends on WATCHDOG_CORE
>   	help
>   	  The option allows to select watchdog pretimeout governors.
>   
>
diff mbox series

Patch

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 242eea859637..fa325b49672e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -2028,6 +2028,7 @@  comment "Watchdog Pretimeout Governors"
 
 config WATCHDOG_PRETIMEOUT_GOV
 	bool "Enable watchdog pretimeout governors"
+	depends on WATCHDOG_CORE
 	help
 	  The option allows to select watchdog pretimeout governors.