diff options
Diffstat (limited to 'drivers/watchdog/hpwdt.c')
-rw-r--r-- | drivers/watchdog/hpwdt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index a5d36ae350dd..00299919df39 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #define HPWDT_VERSION "1.1.1" | 37 | #define HPWDT_VERSION "1.1.1" |
38 | #define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) | 38 | #define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) |
39 | #define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000) | ||
40 | #define HPWDT_MAX_TIMER TICKS_TO_SECS(65535) | ||
39 | #define DEFAULT_MARGIN 30 | 41 | #define DEFAULT_MARGIN 30 |
40 | 42 | ||
41 | static unsigned int soft_margin = DEFAULT_MARGIN; /* in seconds */ | 43 | static unsigned int soft_margin = DEFAULT_MARGIN; /* in seconds */ |
@@ -432,8 +434,7 @@ static void hpwdt_ping(void) | |||
432 | 434 | ||
433 | static int hpwdt_change_timer(int new_margin) | 435 | static int hpwdt_change_timer(int new_margin) |
434 | { | 436 | { |
435 | /* Arbitrary, can't find the card's limits */ | 437 | if (new_margin < 1 || new_margin > HPWDT_MAX_TIMER) { |
436 | if (new_margin < 5 || new_margin > 600) { | ||
437 | printk(KERN_WARNING | 438 | printk(KERN_WARNING |
438 | "hpwdt: New value passed in is invalid: %d seconds.\n", | 439 | "hpwdt: New value passed in is invalid: %d seconds.\n", |
439 | new_margin); | 440 | new_margin); |