Skip to content

Commit

Permalink
crypto: caam - remove unreachable code in report_ccb_status()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
horiag authored and herbertx committed Nov 13, 2016
1 parent 4ca7c7d commit 9305dff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/crypto/caam/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9305dff

Please sign in to comment.