All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: poeschel@lemonage.de, wim@iguana.be, corbet@lwn.net,
	linux-doc@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: omap_wdt: start_enabled module parameter
Date: Fri, 19 Jun 2015 18:44:52 -0700	[thread overview]
Message-ID: <5584C594.70300@roeck-us.net> (raw)
In-Reply-To: <1434719880-12393-1-git-send-email-poeschel@lemonage.de>

On 06/19/2015 06:18 AM, poeschel@lemonage.de wrote:
> From: Lars Poeschel <poeschel@lemonage.de>
>
> Add a start_enabled module parameter to the omap_wdt that starts the
> watchdog on module insertion. The default value is 0 which does not
> start the watchdog - which also does not change the behaviour if the

behavior

> parameter is not given.
>
> Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
> ---
>   Documentation/watchdog/watchdog-parameters.txt |  1 +
>   drivers/watchdog/omap_wdt.c                    | 10 ++++++++++
>   2 files changed, 11 insertions(+)
>
> diff --git a/Documentation/watchdog/watchdog-parameters.txt b/Documentation/watchdog/watchdog-parameters.txt
> index 692791c..fb023bb 100644
> --- a/Documentation/watchdog/watchdog-parameters.txt
> +++ b/Documentation/watchdog/watchdog-parameters.txt
> @@ -208,6 +208,7 @@ nowayout: Watchdog cannot be stopped once started
>   -------------------------------------------------
>   omap_wdt:
>   timer_margin: initial watchdog timeout (in seconds)
> +start_enabled: Watchdog is started on module insertion (default=0)

Please name the parameter early_enable. We have one driver with early_disable,
so this makes it at least to some degree generic.

>   -------------------------------------------------
>   orion_wdt:
>   heartbeat: Initial watchdog heartbeat in seconds
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index a29a61d..7dc8de7 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -53,6 +53,13 @@ static unsigned timer_margin;
>   module_param(timer_margin, uint, 0);
>   MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
>
> +#define START_DEFAULT	0
> +static bool start_enabled = START_DEFAULT;

Please drop the define. Static variables do not need to be initialized to 0.
Cirumventing that with a define to defeat the resulting warning isn't really
the idea.

> +module_param(start_enabled, bool, 0);
> +MODULE_PARM_DESC(start_enabled,
> +	"Watchdog is started on module insertion (default="
> +	__MODULE_STRING(START_DEFAULT) ")");

and just make this default=0.

Thanks,
Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: poeschel@lemonage.de, wim@iguana.be, corbet@lwn.net,
	linux-doc@vger.kernel.org, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: omap_wdt: start_enabled module parameter
Date: Fri, 19 Jun 2015 18:44:52 -0700	[thread overview]
Message-ID: <5584C594.70300@roeck-us.net> (raw)
In-Reply-To: <1434719880-12393-1-git-send-email-poeschel@lemonage.de>

On 06/19/2015 06:18 AM, poeschel@lemonage.de wrote:
> From: Lars Poeschel <poeschel@lemonage.de>
>
> Add a start_enabled module parameter to the omap_wdt that starts the
> watchdog on module insertion. The default value is 0 which does not
> start the watchdog - which also does not change the behaviour if the

behavior

> parameter is not given.
>
> Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
> ---
>   Documentation/watchdog/watchdog-parameters.txt |  1 +
>   drivers/watchdog/omap_wdt.c                    | 10 ++++++++++
>   2 files changed, 11 insertions(+)
>
> diff --git a/Documentation/watchdog/watchdog-parameters.txt b/Documentation/watchdog/watchdog-parameters.txt
> index 692791c..fb023bb 100644
> --- a/Documentation/watchdog/watchdog-parameters.txt
> +++ b/Documentation/watchdog/watchdog-parameters.txt
> @@ -208,6 +208,7 @@ nowayout: Watchdog cannot be stopped once started
>   -------------------------------------------------
>   omap_wdt:
>   timer_margin: initial watchdog timeout (in seconds)
> +start_enabled: Watchdog is started on module insertion (default=0)

Please name the parameter early_enable. We have one driver with early_disable,
so this makes it at least to some degree generic.

>   -------------------------------------------------
>   orion_wdt:
>   heartbeat: Initial watchdog heartbeat in seconds
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index a29a61d..7dc8de7 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -53,6 +53,13 @@ static unsigned timer_margin;
>   module_param(timer_margin, uint, 0);
>   MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
>
> +#define START_DEFAULT	0
> +static bool start_enabled = START_DEFAULT;

Please drop the define. Static variables do not need to be initialized to 0.
Cirumventing that with a define to defeat the resulting warning isn't really
the idea.

> +module_param(start_enabled, bool, 0);
> +MODULE_PARM_DESC(start_enabled,
> +	"Watchdog is started on module insertion (default="
> +	__MODULE_STRING(START_DEFAULT) ")");

and just make this default=0.

Thanks,
Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-06-20  1:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 13:18 [PATCH] watchdog: omap_wdt: start_enabled module parameter poeschel
2015-06-19 13:18 ` poeschel
2015-06-20  1:44 ` Guenter Roeck [this message]
2015-06-20  1:44   ` Guenter Roeck
2015-06-22  8:39   ` Lars Poeschel
2015-06-22  8:39     ` Lars Poeschel

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=5584C594.70300@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=poeschel@lemonage.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.