]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwrng: cn10k - Optimize cn10k_rng_read()
authorVladis Dronov <vdronov@redhat.com>
Wed, 13 Apr 2022 14:16:05 +0000 (16:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:26:02 +0000 (10:26 +0200)
commitcbf08dd84a719d9eab332ad675edc8ba426399f6
treedc9e016ad340d2d749f98719e004f08d506257d2
parent252768d32e92c1214aeebb5fec0844ca479bcf5c
hwrng: cn10k - Optimize cn10k_rng_read()

[ Upstream commit 753d6770879894de10d74b437ab99ea380f1cad7 ]

This function assumes that sizeof(void) is 1 and arithmetic works for
void pointers. This is a GNU C extention and may not work with other
compilers. Change this by using an u8 pointer.

Also move cn10k_read_trng() out of a loop thus saving some cycles.

Fixes: 38e9791a0209 ("hwrng: cn10k - Add random number generator support")
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/hw_random/cn10k-rng.c