diff options
author | Milan Djurovic <mdjurovic@zohomail.com> | 2021-03-16 18:44:03 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-03-26 20:02:35 +1100 |
commit | 3fe993d8e075bf9c143480bb8900b144a6bbe6cd (patch) | |
tree | ea92fcca687d17d92dbfdcd95026c7ab05c5507e | |
parent | 9fe6e510c1be18ca9fd6e66e01412e3ab03ded32 (diff) | |
download | linux-crypto-3fe993d8e075bf9c143480bb8900b144a6bbe6cd.tar.gz linux-crypto-3fe993d8e075bf9c143480bb8900b144a6bbe6cd.zip |
crypto: jitterentropy - Put constants on the right side of the expression
This patch fixes the following checkpatch.pl warnings:
crypto/jitterentropy.c:600: WARNING: Comparisons should place the constant on the right side of the test
crypto/jitterentropy.c:681: WARNING: Comparisons should place the constant on the right side of the test
crypto/jitterentropy.c:772: WARNING: Comparisons should place the constant on the right side of the test
crypto/jitterentropy.c:829: WARNING: Comparisons should place the constant on the right side of the test
Signed-off-by: Milan Djurovic <mdjurovic@zohomail.com>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/jitterentropy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c index 6e147c43..a11b3208 100644 --- a/crypto/jitterentropy.c +++ b/crypto/jitterentropy.c @@ -597,7 +597,7 @@ int jent_read_entropy(struct rand_data *ec, unsigned char *data, if (!ec) return -1; - while (0 < len) { + while (len > 0) { unsigned int tocopy; jent_gen_entropy(ec); @@ -678,7 +678,7 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr, } /* verify and set the oversampling rate */ - if (0 == osr) + if (osr == 0) osr = 1; /* minimum sampling rate is 1 */ entropy_collector->osr = osr; @@ -769,7 +769,7 @@ int jent_entropy_init(void) * etc. with the goal to clear it to get the worst case * measurements. */ - if (CLEARCACHE > i) + if (i < CLEARCACHE) continue; if (stuck) @@ -826,7 +826,7 @@ int jent_entropy_init(void) * should not fail. The value of 3 should cover the NTP case being * performed during our test run. */ - if (3 < time_backwards) + if (time_backwards > 3) return JENT_ENOMONOTONIC; /* |