File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,6 @@ static inline int audit_rate_check(void)
321
321
static DEFINE_SPINLOCK (lock );
322
322
unsigned long flags ;
323
323
unsigned long now ;
324
- unsigned long elapsed ;
325
324
int retval = 0 ;
326
325
327
326
if (!audit_rate_limit ) return 1 ;
@@ -330,9 +329,8 @@ static inline int audit_rate_check(void)
330
329
if (++ messages < audit_rate_limit ) {
331
330
retval = 1 ;
332
331
} else {
333
- now = jiffies ;
334
- elapsed = now - last_check ;
335
- if (elapsed > HZ ) {
332
+ now = jiffies ;
333
+ if (time_after (now , last_check + HZ )) {
336
334
last_check = now ;
337
335
messages = 0 ;
338
336
retval = 1 ;
@@ -366,7 +364,7 @@ void audit_log_lost(const char *message)
366
364
if (!print ) {
367
365
spin_lock_irqsave (& lock , flags );
368
366
now = jiffies ;
369
- if (now - last_msg > HZ ) {
367
+ if (time_after ( now , last_msg + HZ ) ) {
370
368
print = 1 ;
371
369
last_msg = now ;
372
370
}
You can’t perform that action at this time.
0 commit comments