]> www.infradead.org Git - users/dwmw2/linux.git/commit
random: help compiler out with fast_mix() by using simpler arguments
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 6 May 2022 21:19:43 +0000 (23:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:24:07 +0000 (09:24 +0200)
commit3cac6963de9f3014c9b980caede71f2344d47daa
tree5d1ed22681cbdb4b073006e8ef7a200da6439f73
parent1e34e244a3727c13c7f8858c42c3d82bc3d1d818
random: help compiler out with fast_mix() by using simpler arguments

commit 791332b3cbb080510954a4c152ce02af8832eac9 upstream.

Now that fast_mix() has more than one caller, gcc no longer inlines it.
That's fine. But it also doesn't handle the compound literal argument we
pass it very efficiently, nor does it handle the loop as well as it
could. So just expand the code to spell out this function so that it
generates the same code as it did before. Performance-wise, this now
behaves as it did before the last commit. The difference in actual code
size on x86 is 45 bytes, which is less than a cache line.

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