[08/12] staging: ccree: avoid constant comparison

Message ID 1499934004-28513-9-git-send-email-gilad@benyossef.com
State New
Headers show
Series
  • [01/12] staging: ccree remove unnecessary parentheses
Related show

Commit Message

Gilad Ben-Yossef July 13, 2017, 8:19 a.m.
Re-write predicate to avoid constant comparison.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>

---
 drivers/staging/ccree/ssi_aead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.1.4

Patch

diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
index dab4914..8a1c408 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/ssi_aead.c
@@ -1573,7 +1573,7 @@  static int config_ccm_adata(struct aead_request *req)
 
 	/* taken from crypto/ccm.c */
 	/* 2 <= L <= 8, so 1 <= L' <= 7. */
-	if (2 > l || l > 8) {
+	if (l < 2 || l > 8) {
 		SSI_LOG_ERR("illegal iv value %X\n", req->iv[0]);
 		return -EINVAL;
 	}