提交 96c434a2 编写于 作者: J Jason A. Donenfeld 提交者: Zheng Zengkai

random: use proper jiffies comparison macro

stable inclusion
from stable-v5.10.119
commit 9320e087f2b64257f34106eecbfe5a43be5199b0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6BB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9320e087f2b64257f34106eecbfe5a43be5199b0

--------------------------------

commit 8a5b8a4a 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: NJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 b48d2aaf
......@@ -326,7 +326,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);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册