aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c7
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);
1292bool printk_timed_ratelimit(unsigned long *caller_jiffies, 1292bool 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;