From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
linux-crypto@vger.kernel.org, Ofir Drang <ofir.drang@arm.com>
Subject: [PATCH 04/24] staging: ccree: remove MIN/MAX macros
Date: Mon, 13 Nov 2017 14:45:32 +0000 [thread overview]
Message-ID: <1510584358-29473-5-git-send-email-gilad@benyossef.com> (raw)
In-Reply-To: <1510584358-29473-1-git-send-email-gilad@benyossef.com>
The driver was using open coded MIN/MAX macros to
compute fixed defines. Remove them and use bigger
value always instead.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
drivers/staging/ccree/ssi_aead.h | 2 +-
drivers/staging/ccree/ssi_driver.h | 3 ---
drivers/staging/ccree/ssi_hash.c | 2 +-
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/ccree/ssi_aead.h b/drivers/staging/ccree/ssi_aead.h
index e85bcd9..580fdb8 100644
--- a/drivers/staging/ccree/ssi_aead.h
+++ b/drivers/staging/ccree/ssi_aead.h
@@ -28,7 +28,7 @@
/* mac_cmp - HW writes 8 B but all bytes hold the same value */
#define ICV_CMP_SIZE 8
#define CCM_CONFIG_BUF_SIZE (AES_BLOCK_SIZE * 3)
-#define MAX_MAC_SIZE MAX(SHA256_DIGEST_SIZE, AES_BLOCK_SIZE)
+#define MAX_MAC_SIZE SHA256_DIGEST_SIZE
/* defines for AES GCM configuration buffer */
#define GCM_BLOCK_LEN_SIZE 8
diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h
index f4967ca..758268e 100644
--- a/drivers/staging/ccree/ssi_driver.h
+++ b/drivers/staging/ccree/ssi_driver.h
@@ -95,9 +95,6 @@
* field in the HW descriptor. The DMA engine +8 that value.
*/
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
#define SSI_MAX_IVGEN_DMA_ADDRESSES 3
struct ssi_crypto_req {
void (*user_cb)(struct device *dev, void *req);
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index 1fda84d..8414c25 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -32,7 +32,7 @@
#include "ssi_sram_mgr.h"
#define SSI_MAX_AHASH_SEQ_LEN 12
-#define SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE MAX(SSI_MAX_HASH_BLCK_SIZE, 3 * AES_BLOCK_SIZE)
+#define SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE SSI_MAX_HASH_BLCK_SIZE
struct ssi_hash_handle {
ssi_sram_addr_t digest_len_sram_addr; /* const value in SRAM*/
--
2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ofir Drang <ofir.drang@arm.com>,
linux-crypto@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/24] staging: ccree: remove MIN/MAX macros
Date: Mon, 13 Nov 2017 14:45:32 +0000 [thread overview]
Message-ID: <1510584358-29473-5-git-send-email-gilad@benyossef.com> (raw)
In-Reply-To: <1510584358-29473-1-git-send-email-gilad@benyossef.com>
The driver was using open coded MIN/MAX macros to
compute fixed defines. Remove them and use bigger
value always instead.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
drivers/staging/ccree/ssi_aead.h | 2 +-
drivers/staging/ccree/ssi_driver.h | 3 ---
drivers/staging/ccree/ssi_hash.c | 2 +-
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/ccree/ssi_aead.h b/drivers/staging/ccree/ssi_aead.h
index e85bcd9..580fdb8 100644
--- a/drivers/staging/ccree/ssi_aead.h
+++ b/drivers/staging/ccree/ssi_aead.h
@@ -28,7 +28,7 @@
/* mac_cmp - HW writes 8 B but all bytes hold the same value */
#define ICV_CMP_SIZE 8
#define CCM_CONFIG_BUF_SIZE (AES_BLOCK_SIZE * 3)
-#define MAX_MAC_SIZE MAX(SHA256_DIGEST_SIZE, AES_BLOCK_SIZE)
+#define MAX_MAC_SIZE SHA256_DIGEST_SIZE
/* defines for AES GCM configuration buffer */
#define GCM_BLOCK_LEN_SIZE 8
diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h
index f4967ca..758268e 100644
--- a/drivers/staging/ccree/ssi_driver.h
+++ b/drivers/staging/ccree/ssi_driver.h
@@ -95,9 +95,6 @@
* field in the HW descriptor. The DMA engine +8 that value.
*/
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
#define SSI_MAX_IVGEN_DMA_ADDRESSES 3
struct ssi_crypto_req {
void (*user_cb)(struct device *dev, void *req);
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index 1fda84d..8414c25 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -32,7 +32,7 @@
#include "ssi_sram_mgr.h"
#define SSI_MAX_AHASH_SEQ_LEN 12
-#define SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE MAX(SSI_MAX_HASH_BLCK_SIZE, 3 * AES_BLOCK_SIZE)
+#define SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE SSI_MAX_HASH_BLCK_SIZE
struct ssi_hash_handle {
ssi_sram_addr_t digest_len_sram_addr; /* const value in SRAM*/
--
2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
linux-crypto@vger.kernel.org, Ofir Drang <ofir.drang@arm.com>
Subject: [PATCH 04/24] staging: ccree: remove MIN/MAX macros
Date: Mon, 13 Nov 2017 14:45:32 +0000 [thread overview]
Message-ID: <1510584358-29473-5-git-send-email-gilad@benyossef.com> (raw)
In-Reply-To: <1510584358-29473-1-git-send-email-gilad@benyossef.com>
The driver was using open coded MIN/MAX macros to
compute fixed defines. Remove them and use bigger
value always instead.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
drivers/staging/ccree/ssi_aead.h | 2 +-
drivers/staging/ccree/ssi_driver.h | 3 ---
drivers/staging/ccree/ssi_hash.c | 2 +-
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/ccree/ssi_aead.h b/drivers/staging/ccree/ssi_aead.h
index e85bcd9..580fdb8 100644
--- a/drivers/staging/ccree/ssi_aead.h
+++ b/drivers/staging/ccree/ssi_aead.h
@@ -28,7 +28,7 @@
/* mac_cmp - HW writes 8 B but all bytes hold the same value */
#define ICV_CMP_SIZE 8
#define CCM_CONFIG_BUF_SIZE (AES_BLOCK_SIZE * 3)
-#define MAX_MAC_SIZE MAX(SHA256_DIGEST_SIZE, AES_BLOCK_SIZE)
+#define MAX_MAC_SIZE SHA256_DIGEST_SIZE
/* defines for AES GCM configuration buffer */
#define GCM_BLOCK_LEN_SIZE 8
diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h
index f4967ca..758268e 100644
--- a/drivers/staging/ccree/ssi_driver.h
+++ b/drivers/staging/ccree/ssi_driver.h
@@ -95,9 +95,6 @@
* field in the HW descriptor. The DMA engine +8 that value.
*/
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
#define SSI_MAX_IVGEN_DMA_ADDRESSES 3
struct ssi_crypto_req {
void (*user_cb)(struct device *dev, void *req);
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index 1fda84d..8414c25 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -32,7 +32,7 @@
#include "ssi_sram_mgr.h"
#define SSI_MAX_AHASH_SEQ_LEN 12
-#define SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE MAX(SSI_MAX_HASH_BLCK_SIZE, 3 * AES_BLOCK_SIZE)
+#define SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE SSI_MAX_HASH_BLCK_SIZE
struct ssi_hash_handle {
ssi_sram_addr_t digest_len_sram_addr; /* const value in SRAM*/
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2017-11-13 14:45 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 14:45 [PATCH 00/24] staging: ccree: more cleanup patches Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 01/24] staging: ccree: fix typos Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 02/24] staging: ccree: alloc by instance not type Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 03/24] staging: ccree: remove unnecessary parentheses Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef [this message]
2017-11-13 14:45 ` [PATCH 04/24] staging: ccree: remove MIN/MAX macros Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 05/24] staging: ccree: move logical cont. to 1st line Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 06/24] staging: ccree: remove unneeded empty lines Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 07/24] staging: ccree: remove unneeded cast Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 15:41 ` Joe Perches
2017-11-13 15:41 ` Joe Perches
2017-11-14 9:30 ` Gilad Ben-Yossef
2017-11-14 9:30 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 08/24] staging: ccree: make mem barrier per request Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 09/24] staging: ccree: replace open coded loop with for Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 10/24] staging: ccree: document spinlock usage Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 11/24] staging: ccree: constify help string Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 12/24] staging: ccree: fix code indent Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 13/24] staging: ccree: Replace CONFIG_PM_RUNTIME with CONFIG_PM Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 14/24] staging: ccree: replace macro with inline func Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 15/24] staging: ccree: trim long lines for readability Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 16/24] staging: ccree: remove dead defs and decls Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 17/24] staging: ccree: refactor code with local vars Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 18/24] staging: ccree: rename func for readability Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 19/24] staging: ccree: rename long define " Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 20/24] staging: ccree: remove unneeded wrapper function Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 21/24] staging: ccree: remove unused field Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 22/24] staging: ccree: replace msleep with a completion Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 23/24] staging: ccree: use local vars for readability Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` [PATCH 24/24] staging: ccree: drop unused macro Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 14:45 ` Gilad Ben-Yossef
2017-11-13 18:33 ` [PATCH 00/24] staging: ccree: more cleanup patches Dan Carpenter
2017-11-13 18:33 ` Dan Carpenter
2017-11-13 18:33 ` Dan Carpenter
2017-11-14 9:33 ` Gilad Ben-Yossef
2017-11-14 9:33 ` Gilad Ben-Yossef
2017-11-14 9:48 ` Dan Carpenter
2017-11-14 9:48 ` Dan Carpenter
2017-11-15 6:35 ` 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=1510584358-29473-5-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.