Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: testmgr - Wrap the LHS in expressions of the form !x == y

In the test manager, there are a number of if-statements with expressions of
the form !x == y that incur warnings with gcc-5 of the following form:

../crypto/testmgr.c: In function '__test_aead':
../crypto/testmgr.c:523:12: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!ret == template[i].fail) {
^

By converting the 'fail' member of struct aead_testvec and struct
cipher_testvec to a bool, we can get rid of the warnings.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

David Howells and committed by
Herbert Xu
09e21784 f94a3597

+3 -3
+3 -3
crypto/testmgr.h
··· 54 54 unsigned short tap[MAX_TAP]; 55 55 int np; 56 56 unsigned char also_non_np; 57 - unsigned char fail; 57 + bool fail; 58 58 unsigned char wk; /* weak key flag */ 59 59 unsigned char klen; 60 60 unsigned short ilen; ··· 71 71 unsigned char atap[MAX_TAP]; 72 72 int np; 73 73 int anp; 74 - unsigned char fail; 74 + bool fail; 75 75 unsigned char novrfy; /* ccm dec verification failure expected */ 76 76 unsigned char wk; /* weak key flag */ 77 77 unsigned char klen; ··· 3018 3018 "\xb4\x99\x26\xf7\x1f\xe1\xd4\x90", 3019 3019 .rlen = 24, 3020 3020 }, { /* Weak key */ 3021 - .fail = 1, 3021 + .fail = true, 3022 3022 .wk = 1, 3023 3023 .key = "\x01\x01\x01\x01\x01\x01\x01\x01", 3024 3024 .klen = 8,