linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: LKML <linux-kernel@vger.kernel.org>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH] watchdog: fix watchdog_pretimeout.c build error when no default gov. is set
Date: Tue, 7 May 2019 16:33:07 -0700	[thread overview]
Message-ID: <ec5a2b04-2649-e527-bcfd-4e708808e681@infradead.org> (raw)

From: Randy Dunlap <rdunlap@infradead.org>

Fix build error when
CONFIG_WATCHDOG_PRETIMEOUT_GOV=y
# CONFIG_WATCHDOG_PRETIMEOUT_GOV_NOOP is not set
# CONFIG_WATCHDOG_PRETIMEOUT_GOV_PANIC is not set

Fixes this build error:

../drivers/watchdog/watchdog_pretimeout.c: In function ‘watchdog_register_governor’:
../drivers/watchdog/watchdog_pretimeout.c:139:26: error: ‘WATCHDOG_PRETIMEOUT_DEFAULT_GOV’ undeclared (first use in this function)
  if (!strncmp(gov->name, WATCHDOG_PRETIMEOUT_DEFAULT_GOV,

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org
---
Found in linux-next but applies to mainline.

 drivers/watchdog/watchdog_pretimeout.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- linux-next-20190507.orig/drivers/watchdog/watchdog_pretimeout.c
+++ linux-next-20190507/drivers/watchdog/watchdog_pretimeout.c
@@ -118,7 +118,6 @@ EXPORT_SYMBOL_GPL(watchdog_notify_pretim
 
 int watchdog_register_governor(struct watchdog_governor *gov)
 {
-	struct watchdog_pretimeout *p;
 	struct governor_priv *priv;
 
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
@@ -136,8 +135,11 @@ int watchdog_register_governor(struct wa
 	priv->gov = gov;
 	list_add(&priv->entry, &governor_list);
 
+#if defined(WATCHDOG_PRETIMEOUT_DEFAULT_GOV)
 	if (!strncmp(gov->name, WATCHDOG_PRETIMEOUT_DEFAULT_GOV,
 		     WATCHDOG_GOV_NAME_MAXLEN)) {
+		struct watchdog_pretimeout *p;
+
 		spin_lock_irq(&pretimeout_lock);
 		default_gov = gov;
 
@@ -146,6 +148,7 @@ int watchdog_register_governor(struct wa
 				p->wdd->gov = default_gov;
 		spin_unlock_irq(&pretimeout_lock);
 	}
+#endif
 
 	mutex_unlock(&governor_lock);
 



             reply	other threads:[~2019-05-07 23:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 23:33 Randy Dunlap [this message]
2019-05-08  0:07 ` [PATCH] watchdog: fix watchdog_pretimeout.c build error when no default gov. is set Guenter Roeck
2019-05-08  0:22   ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec5a2b04-2649-e527-bcfd-4e708808e681@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=vladimir_zapolskiy@mentor.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).