linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [v7, RESEND] watchdog: Add watchdog timer support for the WinSystems EBC-C384
Date: Sun, 28 Feb 2016 20:45:46 -0800	[thread overview]
Message-ID: <20160229044546.GA31388@roeck-us.net> (raw)
In-Reply-To: <20160229042910.GA23468@sophia>

Hi William,

On Sun, Feb 28, 2016 at 11:29:10PM -0500, William Breathitt Gray wrote:
> The WinSystems EBC-C384 has an onboard watchdog timer. The timeout range
> supported by the watchdog timer is 1 second to 255 minutes. Timeouts
> under 256 seconds have a 1 second granularity, while the rest have a 1
> minute granularity.
> 
> This driver adds watchdog timer support for this onboard watchdog timer.
> The timeout may be configured via the timeout module parameter.
> 
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  MAINTAINERS                     |   6 ++
>  drivers/watchdog/Kconfig        |   9 ++
>  drivers/watchdog/Makefile       |   1 +
>  drivers/watchdog/ebc-c384_wdt.c | 188 ++++++++++++++++++++++++++++++++++++++++
> 
[ ... ]

> +
> +static int ebc_c384_wdt_set_timeout(struct watchdog_device *wdev, unsigned t)
> +{
> +	/* resolution is in minutes for timeouts greater than 255 seconds */
> +	if (t > 255) {
> +		/* round second resolution up to minute granularity */
> +		wdev->timeout = DIV_ROUND_UP(t, 60) * 60;

Good catch.

Turns out there is a much better macro for this:
		wdev->timeout = roundup(t, 60);

Guenter

      reply	other threads:[~2016-02-29  4:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  4:29 [PATCH v7 RESEND] watchdog: Add watchdog timer support for the WinSystems EBC-C384 William Breathitt Gray
2016-02-29  4:45 ` Guenter Roeck [this message]

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=20160229044546.GA31388@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=vilhelm.gray@gmail.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;
as well as URLs for NNTP newsgroup(s).