]> git.baikalelectronics.ru Git - kernel.git/commit
hwrng: cn10k - Optimize cn10k_rng_read()
authorVladis Dronov <vdronov@redhat.com>
Wed, 13 Apr 2022 14:16:05 +0000 (16:16 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 21 Apr 2022 09:53:54 +0000 (17:53 +0800)
commit1fb4d23f8b7866f7ff4c5a5c84845d7923ca0242
tree44ceb4592cdbcbf199d29b03dcd96cf776cd955b
parentc709afda71baa0397af278b83a7ca4eca8948af6
hwrng: cn10k - Optimize cn10k_rng_read()

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: a64a4f7b968e ("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>
drivers/char/hw_random/cn10k-rng.c