diff options
author | Yanjiang Jin <yanjiang.jin@windriver.com> | 2016-07-29 04:32:09 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-08-09 06:47:19 -0400 |
commit | 0fae0c1e1d7991ce0dbefdd1c35c14e9d0025cc2 (patch) | |
tree | 00bfce3e989cc5b9ec5ac2652e2924d96765f2e3 /crypto/testmgr.c | |
parent | e14e7d126765ce0156ab5e3b250b1270998c207d (diff) |
crypto: testmgr - fix !x==y confusion
"if (!ret == template[i].fail)" is confusing to compilers (gcc5):
crypto/testmgr.c: In function '__test_aead':
crypto/testmgr.c:531:12: warning: logical not is only applied to the
left hand side of comparison [-Wlogical-not-parentheses]
if (!ret == template[i].fail) {
^
Let there be 'if (template[i].fail == !ret) '.
Signed-off-by: Yanjiang Jin <yanjiang.jin@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r-- | crypto/testmgr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 5c9d5a5e7b65..c2a8bd38ef1f 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -665,7 +665,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
665 | memcpy(key, template[i].key, template[i].klen); | 665 | memcpy(key, template[i].key, template[i].klen); |
666 | 666 | ||
667 | ret = crypto_aead_setkey(tfm, key, template[i].klen); | 667 | ret = crypto_aead_setkey(tfm, key, template[i].klen); |
668 | if (!ret == template[i].fail) { | 668 | if (template[i].fail == !ret) { |
669 | pr_err("alg: aead%s: setkey failed on test %d for %s: flags=%x\n", | 669 | pr_err("alg: aead%s: setkey failed on test %d for %s: flags=%x\n", |
670 | d, j, algo, crypto_aead_get_flags(tfm)); | 670 | d, j, algo, crypto_aead_get_flags(tfm)); |
671 | goto out; | 671 | goto out; |
@@ -770,7 +770,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc, | |||
770 | memcpy(key, template[i].key, template[i].klen); | 770 | memcpy(key, template[i].key, template[i].klen); |
771 | 771 | ||
772 | ret = crypto_aead_setkey(tfm, key, template[i].klen); | 772 | ret = crypto_aead_setkey(tfm, key, template[i].klen); |
773 | if (!ret == template[i].fail) { | 773 | if (template[i].fail == !ret) { |
774 | pr_err("alg: aead%s: setkey failed on chunk test %d for %s: flags=%x\n", | 774 | pr_err("alg: aead%s: setkey failed on chunk test %d for %s: flags=%x\n", |
775 | d, j, algo, crypto_aead_get_flags(tfm)); | 775 | d, j, algo, crypto_aead_get_flags(tfm)); |
776 | goto out; | 776 | goto out; |
@@ -1023,7 +1023,7 @@ static int test_cipher(struct crypto_cipher *tfm, int enc, | |||
1023 | 1023 | ||
1024 | ret = crypto_cipher_setkey(tfm, template[i].key, | 1024 | ret = crypto_cipher_setkey(tfm, template[i].key, |
1025 | template[i].klen); | 1025 | template[i].klen); |
1026 | if (!ret == template[i].fail) { | 1026 | if (template[i].fail == !ret) { |
1027 | printk(KERN_ERR "alg: cipher: setkey failed " | 1027 | printk(KERN_ERR "alg: cipher: setkey failed " |
1028 | "on test %d for %s: flags=%x\n", j, | 1028 | "on test %d for %s: flags=%x\n", j, |
1029 | algo, crypto_cipher_get_flags(tfm)); | 1029 | algo, crypto_cipher_get_flags(tfm)); |
@@ -1133,7 +1133,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
1133 | 1133 | ||
1134 | ret = crypto_skcipher_setkey(tfm, template[i].key, | 1134 | ret = crypto_skcipher_setkey(tfm, template[i].key, |
1135 | template[i].klen); | 1135 | template[i].klen); |
1136 | if (!ret == template[i].fail) { | 1136 | if (template[i].fail == !ret) { |
1137 | pr_err("alg: skcipher%s: setkey failed on test %d for %s: flags=%x\n", | 1137 | pr_err("alg: skcipher%s: setkey failed on test %d for %s: flags=%x\n", |
1138 | d, j, algo, crypto_skcipher_get_flags(tfm)); | 1138 | d, j, algo, crypto_skcipher_get_flags(tfm)); |
1139 | goto out; | 1139 | goto out; |
@@ -1211,7 +1211,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
1211 | 1211 | ||
1212 | ret = crypto_skcipher_setkey(tfm, template[i].key, | 1212 | ret = crypto_skcipher_setkey(tfm, template[i].key, |
1213 | template[i].klen); | 1213 | template[i].klen); |
1214 | if (!ret == template[i].fail) { | 1214 | if (template[i].fail == !ret) { |
1215 | pr_err("alg: skcipher%s: setkey failed on chunk test %d for %s: flags=%x\n", | 1215 | pr_err("alg: skcipher%s: setkey failed on chunk test %d for %s: flags=%x\n", |
1216 | d, j, algo, crypto_skcipher_get_flags(tfm)); | 1216 | d, j, algo, crypto_skcipher_get_flags(tfm)); |
1217 | goto out; | 1217 | goto out; |