random: use proper jiffies comparison macro
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 10 May 2022 13:20:42 +0000 (15:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:40 +0000 (11:46 +0200)
commit 8a5b8a4a4ceb353b4dd5bafd09e2b15751bcdb51 upstream.

This expands to exactly the same code that it replaces, but makes things
consistent by using the same macro for jiffy comparisons throughout.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c

index 748e0a6c633ace6a66ab8e3eba59e6c9adb3c5f7..9b4145d7cd2a312935131939f934fcfd53d24e87 100644 (file)
@@ -324,7 +324,7 @@ static bool crng_has_old_seed(void)
                        interval = max_t(unsigned int, CRNG_RESEED_START_INTERVAL,
                                         (unsigned int)uptime / 2 * HZ);
        }
-       return time_after(jiffies, READ_ONCE(base_crng.birth) + interval);
+       return time_is_before_jiffies(READ_ONCE(base_crng.birth) + interval);
 }
 
 /*