diff options
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index e3602d0755b0..2be719908d1f 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -1292,8 +1292,11 @@ EXPORT_SYMBOL(printk_ratelimit); | |||
1292 | bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 1292 | bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
1293 | unsigned int interval_msecs) | 1293 | unsigned int interval_msecs) |
1294 | { | 1294 | { |
1295 | if (*caller_jiffies == 0 || time_after(jiffies, *caller_jiffies)) { | 1295 | if (*caller_jiffies == 0 |
1296 | *caller_jiffies = jiffies + msecs_to_jiffies(interval_msecs); | 1296 | || !time_in_range(jiffies, *caller_jiffies, |
1297 | *caller_jiffies | ||
1298 | + msecs_to_jiffies(interval_msecs))) { | ||
1299 | *caller_jiffies = jiffies; | ||
1297 | return true; | 1300 | return true; |
1298 | } | 1301 | } |
1299 | return false; | 1302 | return false; |