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 a5f61a9acedb..5052b5497c67 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1311,8 +1311,11 @@ EXPORT_SYMBOL(printk_ratelimit);
1311bool printk_timed_ratelimit(unsigned long *caller_jiffies, 1311bool printk_timed_ratelimit(unsigned long *caller_jiffies,
1312 unsigned int interval_msecs) 1312 unsigned int interval_msecs)
1313{ 1313{
1314 if (*caller_jiffies == 0 || time_after(jiffies, *caller_jiffies)) { 1314 if (*caller_jiffies == 0
1315 *caller_jiffies = jiffies + msecs_to_jiffies(interval_msecs); 1315 || !time_in_range(jiffies, *caller_jiffies,
1316 *caller_jiffies
1317 + msecs_to_jiffies(interval_msecs))) {
1318 *caller_jiffies = jiffies;
1316 return true; 1319 return true;
1317 } 1320 }
1318 return false; 1321 return false;