crypto: caam - remove unreachable code in report_ccb_status()
authorHoria Geantă <horia.geanta@nxp.com>
Wed, 9 Nov 2016 08:46:19 +0000 (10:46 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 13 Nov 2016 09:45:12 +0000 (17:45 +0800)
ERRID is a 4-bit field.
Since err_id values are in [0..15] and err_id_list array size is 16,
the condition "err_id < ARRAY_SIZE(err_id_list)" is always true.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/error.c

index 33e41ea83fcca2aa566990d86c512433d7729ef8..79a0cc70717f9c3d0c733103dd36f7c775819b1a 100644 (file)
@@ -146,10 +146,9 @@ static void report_ccb_status(struct device *jrdev, const u32 status,
            strlen(rng_err_id_list[err_id])) {
                /* RNG-only error */
                err_str = rng_err_id_list[err_id];
-       } else if (err_id < ARRAY_SIZE(err_id_list))
+       } else {
                err_str = err_id_list[err_id];
-       else
-               snprintf(err_err_code, sizeof(err_err_code), "%02x", err_id);
+       }
 
        /*
         * CCB ICV check failures are part of normal operation life;