From: dann frazier <dannf@hp.com>
To: Wim Van Sebroeck <wim@iguana.be>
Cc: linux-kernel@vger.kernel.org,
Thomas Mingarelli <thomas.mingarelli@hp.com>,
dann frazier <dannf@hp.com>
Subject: [PATCH 1/3] hpwdt: Introduce SECS_TO_TICKS() macro
Date: Wed, 2 Jun 2010 16:23:39 -0600 [thread overview]
Message-ID: <1275517421-10544-1-git-send-email-dannf@hp.com> (raw)
Define a macro to convert from seconds to timer ticks.
Signed-off-by: dann frazier <dannf@hp.com>
---
drivers/watchdog/hpwdt.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 809e716..af61fb6 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -49,6 +49,8 @@
#define ROM_SIZE 0x10000
#define HPWDT_VERSION "1.1.1"
+#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
+
struct bios32_service_dir {
u32 signature;
u32 entry_point;
@@ -420,7 +422,7 @@ static int __devinit detect_cru_service(void)
*/
static void hpwdt_start(void)
{
- reload = (soft_margin * 1000) / 128;
+ reload = SECS_TO_TICKS(soft_margin);
iowrite16(reload, hpwdt_timer_reg);
iowrite16(0x85, hpwdt_timer_con);
}
@@ -453,7 +455,7 @@ static int hpwdt_change_timer(int new_margin)
printk(KERN_DEBUG
"hpwdt: New timer passed in is %d seconds.\n",
new_margin);
- reload = (soft_margin * 1000) / 128;
+ reload = SECS_TO_TICKS(soft_margin);
return 0;
}
--
1.7.1
next reply other threads:[~2010-06-02 22:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-02 22:23 dann frazier [this message]
2010-06-02 22:23 ` [PATCH 2/3] hpwdt: allow full range of timer values supported by hardware dann frazier
2010-06-02 22:23 ` [PATCH 3/3] hpwdt: implement WDIOC_GETTIMELEFT dann frazier
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=1275517421-10544-1-git-send-email-dannf@hp.com \
--to=dannf@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.mingarelli@hp.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).