Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79699
b: refs/heads/master
c: 45fe4fe
h: refs/heads/master
i:
  79697: c05cacd
  79695: 1506c9b
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent e56fd24 commit 5cafd7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1a0c009ac53de4a7664a1239936f0bc258133156
refs/heads/master: 45fe4fe19120a22f7339f5bb110447170c25fca9
13 changes: 13 additions & 0 deletions trunk/kernel/time/clockevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ unsigned long clockevent_delta2ns(unsigned long latch,
{
u64 clc = ((u64) latch << evt->shift);

if (unlikely(!evt->mult)) {
evt->mult = 1;
WARN_ON(1);
}

do_div(clc, evt->mult);
if (clc < 1000)
clc = 1000;
Expand Down Expand Up @@ -151,6 +156,14 @@ static void clockevents_notify_released(void)
void clockevents_register_device(struct clock_event_device *dev)
{
BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
/*
* A nsec2cyc multiplicator of 0 is invalid and we'd crash
* on it, so fix it up and emit a warning:
*/
if (unlikely(!dev->mult)) {
dev->mult = 1;
WARN_ON(1);
}

spin_lock(&clockevents_lock);

Expand Down

0 comments on commit 5cafd7a

Please sign in to comment.