From: <Sergey.Semin@baikalelectronics.ru>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>
Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
Serge Semin <fancer.lancer@gmail.com>,
Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Paul Burton <paulburton@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
<linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/7] watchdog: watchdog_dev: Use generic msec-per-sec macro
Date: Fri, 6 Mar 2020 16:27:43 +0300 [thread overview]
Message-ID: <20200306132823.D5C5B803087C@mail.baikalelectronics.ru> (raw)
In-Reply-To: <20200306132747.14701-1-Sergey.Semin@baikalelectronics.ru>
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
For better readability replace the numeric literals with globally
available xSEC_PER_SEC macro.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
drivers/watchdog/watchdog_dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 8b5c742f24e8..a1a3bbe21653 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -99,7 +99,7 @@ static inline bool watchdog_need_worker(struct watchdog_device *wdd)
{
/* All variables in milli-seconds */
unsigned int hm = wdd->max_hw_heartbeat_ms;
- unsigned int t = wdd->timeout * 1000;
+ unsigned int t = wdd->timeout * MSEC_PER_SEC;
/*
* A worker to generate heartbeat requests is needed if all of the
@@ -121,7 +121,7 @@ static inline bool watchdog_need_worker(struct watchdog_device *wdd)
static ktime_t watchdog_next_keepalive(struct watchdog_device *wdd)
{
struct watchdog_core_data *wd_data = wdd->wd_data;
- unsigned int timeout_ms = wdd->timeout * 1000;
+ unsigned int timeout_ms = wdd->timeout * MSEC_PER_SEC;
ktime_t keepalive_interval;
ktime_t last_heartbeat, latest_heartbeat;
ktime_t virt_timeout;
--
2.25.1
next prev parent reply other threads:[~2020-03-06 13:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200306132747.14701-1-Sergey.Semin@baikalelectronics.ru>
2020-03-06 13:27 ` [PATCH 1/7] dt-bindings: watchdog: dw-wdt: Replace legacy bindings file with YAML-based one Sergey.Semin
2020-03-06 15:18 ` Guenter Roeck
[not found] ` <20200306151839.374AA80307C2@mail.baikalelectronics.ru>
2020-04-07 17:48 ` Sergey Semin
2020-03-06 13:27 ` [PATCH 2/7] dt-bindings: watchdog: dw-wdt: Add watchdog TOPs array property Sergey.Semin
2020-03-12 22:22 ` Rob Herring
2020-03-06 13:27 ` Sergey.Semin [this message]
2020-03-06 15:20 ` [PATCH 3/7] watchdog: watchdog_dev: Use generic msec-per-sec macro Guenter Roeck
[not found] ` <20200306152033.4444780307C4@mail.baikalelectronics.ru>
2020-04-09 18:56 ` Sergey Semin
2020-03-06 13:27 ` [PATCH 4/7] watchdog: dw_wdt: Support devices with non-fixed TOP values Sergey.Semin
2020-03-15 14:12 ` Guenter Roeck
2020-04-10 12:59 ` Sergey Semin
2020-04-10 16:21 ` Guenter Roeck
2020-04-10 19:45 ` Sergey Semin
2020-04-11 1:15 ` Guenter Roeck
2020-04-11 11:10 ` Sergey Semin
2020-03-06 13:27 ` [PATCH 5/7] watchdog: dw_wdt: Support devices with asynch clocks Sergey.Semin
2020-03-15 14:22 ` Guenter Roeck
2020-04-10 18:59 ` Sergey Semin
2020-04-13 20:52 ` Stephen Boyd
2020-04-14 2:55 ` Guenter Roeck
2020-04-14 10:01 ` Sergey Semin
2020-03-06 13:27 ` [PATCH 6/7] watchdog: dw_wdt: Add pre-timeouts support Sergey.Semin
2020-03-06 15:14 ` Guenter Roeck
[not found] ` <20200306151455.7470180307C4@mail.baikalelectronics.ru>
2020-04-10 19:04 ` Sergey Semin
2020-03-06 13:27 ` [PATCH 7/7] watchdog: dw_wdt: Add DebugFS files Sergey.Semin
2020-03-06 15:12 ` Guenter Roeck
[not found] ` <20200306151248.DE1EC80307C4@mail.baikalelectronics.ru>
2020-04-10 19:12 ` Sergey Semin
2020-03-10 0:32 ` [PATCH 0/7] watchdog: dw_wdt: Take Baikal-T1 DW WDT peculiarities into account Sergey Semin
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=20200306132823.D5C5B803087C@mail.baikalelectronics.ru \
--to=sergey.semin@baikalelectronics.ru \
--cc=Alexey.Malahov@baikalelectronics.ru \
--cc=fancer.lancer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=paulburton@kernel.org \
--cc=ralf@linux-mips.org \
--cc=tsbogend@alpha.franken.de \
--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).