public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Andrew Bresticker <abrestic@chromium.org>,
	Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Naidu Tellapati <naidu.tellapati@imgtec.com>,
	Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Subject: Re: [PATCH 2/4] watchdog: imgpdc: Intialize timeout to default value
Date: Tue, 31 Mar 2015 12:02:46 -0700	[thread overview]
Message-ID: <551AEF56.4070504@roeck-us.net> (raw)
In-Reply-To: <1427827751-19705-2-git-send-email-abrestic@chromium.org>

On 03/31/2015 11:49 AM, Andrew Bresticker wrote:
> From: Naidu Tellapati <naidu.tellapati@imgtec.com>
>
> Currently the watchdog timeout is initialized to 0.  Initialize it to
> its default value instead.
>
> Signed-off-by: Naidu Tellapati <naidu.tellapati@imgtec.com>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
> ---
>   drivers/watchdog/imgpdc_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c
> index c4151cd..f3f65ac 100644
> --- a/drivers/watchdog/imgpdc_wdt.c
> +++ b/drivers/watchdog/imgpdc_wdt.c
> @@ -42,7 +42,7 @@
>   #define PDC_WDT_MIN_TIMEOUT		1
>   #define PDC_WDT_DEF_TIMEOUT		64
>
> -static int heartbeat;
> +static int heartbeat = PDC_WDT_DEF_TIMEOUT;
>   module_param(heartbeat, int, 0);
>   MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. "
>   	"(default = " __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")");
>

The idea with watchdog_init_timeout() is that it can take the
timeout from devicetree unless the module parameter is provided.
By pre-initializing the module parameter, you defeat that and
make watchdog_init_timeout more or less a no-op. You might as well
set pdc_wdt->wdt_dev.timeout directly and not call watchdog_init_timeout
at all if that is what you want.

The "expected" solution would be to pre-initialize pdc_wdt->wdt_dev.timeout
but leave the module parameter alone.

Guenter


  reply	other threads:[~2015-03-31 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 18:49 [PATCH 1/4] watchdog: imgpdc: Fix NULL pointer dereference on probe Andrew Bresticker
2015-03-31 18:49 ` [PATCH 2/4] watchdog: imgpdc: Intialize timeout to default value Andrew Bresticker
2015-03-31 19:02   ` Guenter Roeck [this message]
2015-03-31 19:34     ` Andrew Bresticker
2015-03-31 18:49 ` [PATCH 3/4] watchdog: imgpdc: Set timeout before starting watchdog Andrew Bresticker
2015-04-01  3:50   ` Guenter Roeck
2015-03-31 18:49 ` [PATCH 4/4] watchdog: imgpdc: Add reboot support Andrew Bresticker
2015-04-01  3:51   ` Guenter Roeck
2015-03-31 19:37 ` [PATCH 1/4] watchdog: imgpdc: Fix NULL pointer dereference on probe Andrew Bresticker

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=551AEF56.4070504@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=abrestic@chromium.org \
    --cc=ezequiel.garcia@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=naidu.tellapati@imgtec.com \
    --cc=wim@iguana.be \
    /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