rand uniform: fix likely usage

@mspncp noted that the condition should have been likely not unlikely.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22593)
This commit is contained in:
Pauli 2023-11-02 12:26:50 +11:00 committed by Tomas Mraz
parent 3fa274ca81
commit b90662b4b0

View File

@ -85,7 +85,7 @@ uint32_t ossl_rand_uniform_uint32(OSSL_LIB_CTX *ctx, uint32_t upper, int *err)
if (f < f2)
return i + 1;
/* For not all 1 bits, there is no carry so return the result */
if (unlikely(f != 0xffffffff))
if (likely(f != 0xffffffff))
return i;
/* setup for the next word of randomness */
f = prod & 0xffffffff;