All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-crypto@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Ofir Drang <ofir.drang@arm.com>
Subject: [PATCH 08/12] staging: ccree: avoid constant comparison
Date: Thu, 13 Jul 2017 11:19:58 +0300	[thread overview]
Message-ID: <1499934004-28513-9-git-send-email-gilad@benyossef.com> (raw)
In-Reply-To: <1499934004-28513-1-git-send-email-gilad@benyossef.com>

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(-)

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;
 	}
-- 
2.1.4

WARNING: multiple messages have this Message-ID (diff)
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-crypto@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Ofir Drang <ofir.drang@arm.com>
Subject: [PATCH 08/12] staging: ccree: avoid constant comparison
Date: Thu, 13 Jul 2017 11:19:58 +0300	[thread overview]
Message-ID: <1499934004-28513-9-git-send-email-gilad@benyossef.com> (raw)
In-Reply-To: <1499934004-28513-1-git-send-email-gilad@benyossef.com>

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(-)

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;
 	}
-- 
2.1.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2017-07-13  8:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13  8:19 [PATCH 00/12] staging: ccree: coding style fixes Gilad Ben-Yossef
2017-07-13  8:19 ` Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 01/12] staging: ccree remove unnecessary parentheses Gilad Ben-Yossef
2017-07-13  8:19   ` Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 02/12] staging: ccree: clean up struct ssi_aead_ctx Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 03/12] staging: ccree: use proper printk format for dma_addr_t Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 04/12] staging: ccree: fix parenthesis alignment Gilad Ben-Yossef
2017-07-13  8:19   ` Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 05/12] staging: ccree: fix split strings Gilad Ben-Yossef
2017-07-13  8:19   ` Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 06/12] staging: ccree: CamelCase to snake_case in func vars Gilad Ben-Yossef
2017-07-13  8:19   ` Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 07/12] staging: ccree: CamelCase to snake_case in aead struct Gilad Ben-Yossef
2017-07-13  8:19   ` Gilad Ben-Yossef
2017-07-13  8:19 ` Gilad Ben-Yossef [this message]
2017-07-13  8:19   ` [PATCH 08/12] staging: ccree: avoid constant comparison Gilad Ben-Yossef
2017-07-13  8:19 ` [PATCH 09/12] staging: ccree: avoid unnecessary line continuation Gilad Ben-Yossef
2017-07-13  8:19   ` Gilad Ben-Yossef
2017-07-13  8:20 ` [PATCH 10/12] staging: ccree: remove func name from log messages Gilad Ben-Yossef
2017-07-13  8:20   ` Gilad Ben-Yossef
2017-07-13  8:20 ` [PATCH 11/12] staging: ccree: kmalloc by sizeof var not type Gilad Ben-Yossef
2017-07-13  8:20   ` Gilad Ben-Yossef
2017-07-13  8:20 ` [PATCH 12/12] staging: ccree: remove whitespace before a quoted newline Gilad Ben-Yossef
2017-07-13  8:20   ` Gilad Ben-Yossef
2017-07-14 11:39 ` [PATCH 00/12] staging: ccree: coding style fixes Greg Kroah-Hartman
2017-07-14 11:39   ` Greg Kroah-Hartman
2017-07-14 15:28   ` Gilad Ben-Yossef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499934004-28513-9-git-send-email-gilad@benyossef.com \
    --to=gilad@benyossef.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ofir.drang@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.