crypto: tcrypt - mark expected switch fall-throughs in do_test()

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Gustavo A. R. Silva 2017-10-09 14:43:21 -05:00 committed by Herbert Xu
parent 396d34f953
commit 59517226a3

View File

@ -1606,119 +1606,116 @@ static int do_test(const char *alg, u32 type, u32 mask, int m)
speed_template_32); speed_template_32);
break; break;
case 300: case 300:
if (alg) { if (alg) {
test_hash_speed(alg, sec, generic_hash_speed_template); test_hash_speed(alg, sec, generic_hash_speed_template);
break; break;
} }
/* fall through */ /* fall through */
case 301: case 301:
test_hash_speed("md4", sec, generic_hash_speed_template); test_hash_speed("md4", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 302: case 302:
test_hash_speed("md5", sec, generic_hash_speed_template); test_hash_speed("md5", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 303: case 303:
test_hash_speed("sha1", sec, generic_hash_speed_template); test_hash_speed("sha1", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 304: case 304:
test_hash_speed("sha256", sec, generic_hash_speed_template); test_hash_speed("sha256", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 305: case 305:
test_hash_speed("sha384", sec, generic_hash_speed_template); test_hash_speed("sha384", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 306: case 306:
test_hash_speed("sha512", sec, generic_hash_speed_template); test_hash_speed("sha512", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 307: case 307:
test_hash_speed("wp256", sec, generic_hash_speed_template); test_hash_speed("wp256", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 308: case 308:
test_hash_speed("wp384", sec, generic_hash_speed_template); test_hash_speed("wp384", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 309: case 309:
test_hash_speed("wp512", sec, generic_hash_speed_template); test_hash_speed("wp512", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 310: case 310:
test_hash_speed("tgr128", sec, generic_hash_speed_template); test_hash_speed("tgr128", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 311: case 311:
test_hash_speed("tgr160", sec, generic_hash_speed_template); test_hash_speed("tgr160", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 312: case 312:
test_hash_speed("tgr192", sec, generic_hash_speed_template); test_hash_speed("tgr192", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 313: case 313:
test_hash_speed("sha224", sec, generic_hash_speed_template); test_hash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 314: case 314:
test_hash_speed("rmd128", sec, generic_hash_speed_template); test_hash_speed("rmd128", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 315: case 315:
test_hash_speed("rmd160", sec, generic_hash_speed_template); test_hash_speed("rmd160", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 316: case 316:
test_hash_speed("rmd256", sec, generic_hash_speed_template); test_hash_speed("rmd256", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 317: case 317:
test_hash_speed("rmd320", sec, generic_hash_speed_template); test_hash_speed("rmd320", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 318: case 318:
test_hash_speed("ghash-generic", sec, hash_speed_template_16); test_hash_speed("ghash-generic", sec, hash_speed_template_16);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 319: case 319:
test_hash_speed("crc32c", sec, generic_hash_speed_template); test_hash_speed("crc32c", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 320: case 320:
test_hash_speed("crct10dif", sec, generic_hash_speed_template); test_hash_speed("crct10dif", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 321: case 321:
test_hash_speed("poly1305", sec, poly1305_speed_template); test_hash_speed("poly1305", sec, poly1305_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 322: case 322:
test_hash_speed("sha3-224", sec, generic_hash_speed_template); test_hash_speed("sha3-224", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 323: case 323:
test_hash_speed("sha3-256", sec, generic_hash_speed_template); test_hash_speed("sha3-256", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 324: case 324:
test_hash_speed("sha3-384", sec, generic_hash_speed_template); test_hash_speed("sha3-384", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 325: case 325:
test_hash_speed("sha3-512", sec, generic_hash_speed_template); test_hash_speed("sha3-512", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 326: case 326:
test_hash_speed("sm3", sec, generic_hash_speed_template); test_hash_speed("sm3", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break; if (mode > 300 && mode < 400) break;
/* fall through */
case 399: case 399:
break; break;
@ -1727,110 +1724,107 @@ static int do_test(const char *alg, u32 type, u32 mask, int m)
test_ahash_speed(alg, sec, generic_hash_speed_template); test_ahash_speed(alg, sec, generic_hash_speed_template);
break; break;
} }
/* fall through */ /* fall through */
case 401: case 401:
test_ahash_speed("md4", sec, generic_hash_speed_template); test_ahash_speed("md4", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 402: case 402:
test_ahash_speed("md5", sec, generic_hash_speed_template); test_ahash_speed("md5", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 403: case 403:
test_ahash_speed("sha1", sec, generic_hash_speed_template); test_ahash_speed("sha1", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 404: case 404:
test_ahash_speed("sha256", sec, generic_hash_speed_template); test_ahash_speed("sha256", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 405: case 405:
test_ahash_speed("sha384", sec, generic_hash_speed_template); test_ahash_speed("sha384", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 406: case 406:
test_ahash_speed("sha512", sec, generic_hash_speed_template); test_ahash_speed("sha512", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 407: case 407:
test_ahash_speed("wp256", sec, generic_hash_speed_template); test_ahash_speed("wp256", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 408: case 408:
test_ahash_speed("wp384", sec, generic_hash_speed_template); test_ahash_speed("wp384", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 409: case 409:
test_ahash_speed("wp512", sec, generic_hash_speed_template); test_ahash_speed("wp512", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 410: case 410:
test_ahash_speed("tgr128", sec, generic_hash_speed_template); test_ahash_speed("tgr128", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 411: case 411:
test_ahash_speed("tgr160", sec, generic_hash_speed_template); test_ahash_speed("tgr160", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 412: case 412:
test_ahash_speed("tgr192", sec, generic_hash_speed_template); test_ahash_speed("tgr192", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 413: case 413:
test_ahash_speed("sha224", sec, generic_hash_speed_template); test_ahash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 414: case 414:
test_ahash_speed("rmd128", sec, generic_hash_speed_template); test_ahash_speed("rmd128", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 415: case 415:
test_ahash_speed("rmd160", sec, generic_hash_speed_template); test_ahash_speed("rmd160", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 416: case 416:
test_ahash_speed("rmd256", sec, generic_hash_speed_template); test_ahash_speed("rmd256", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 417: case 417:
test_ahash_speed("rmd320", sec, generic_hash_speed_template); test_ahash_speed("rmd320", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 418: case 418:
test_ahash_speed("sha3-224", sec, generic_hash_speed_template); test_ahash_speed("sha3-224", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 419: case 419:
test_ahash_speed("sha3-256", sec, generic_hash_speed_template); test_ahash_speed("sha3-256", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 420: case 420:
test_ahash_speed("sha3-384", sec, generic_hash_speed_template); test_ahash_speed("sha3-384", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 421: case 421:
test_ahash_speed("sha3-512", sec, generic_hash_speed_template); test_ahash_speed("sha3-512", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 422: case 422:
test_mb_ahash_speed("sha1", sec, generic_hash_speed_template); test_mb_ahash_speed("sha1", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 423: case 423:
test_mb_ahash_speed("sha256", sec, generic_hash_speed_template); test_mb_ahash_speed("sha256", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 424: case 424:
test_mb_ahash_speed("sha512", sec, generic_hash_speed_template); test_mb_ahash_speed("sha512", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 425: case 425:
test_mb_ahash_speed("sm3", sec, generic_hash_speed_template); test_mb_ahash_speed("sm3", sec, generic_hash_speed_template);
if (mode > 400 && mode < 500) break; if (mode > 400 && mode < 500) break;
/* fall through */
case 499: case 499:
break; break;