Re: [Outreachy kernel] [PATCH v2] Staging: ccree: Remove unused variable monitor_lock

2017-09-11 Thread Gilad Ben-Yossef
ver I've missed when I deleted an implementation of something that was almost, but not quite, entirely unlike perf and is no longer used. So, assuming it compiles fine (I'm away from my build infrastructure at the moment): Acked-by: Gilad Ben-Yossef Thank you, Gilad > >> ---

Re: [PATCH] staging:ccree Fix use BIT macro

2017-09-24 Thread Gilad Ben-Yossef
such a fix s already present in the staging-next tree. I suggest you base your patches to ccree on that tree as it is the most current for this driver. Thanks again, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where

Re: [PATCH] staging:ccree Fix avoid externs in .c files

2017-09-24 Thread Gilad Ben-Yossef
eing things that are already gone from the downstream staging tree. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -

[PATCH 0/4] staging: ccree: logging related coding style fixes

2017-10-02 Thread Gilad Ben-Yossef
. Patch set based upon commit 1cd5929ab675 ("staging: greybus: light: remove unnecessary error check") in the staging-next tree. Signed-off-by: Gilad Ben-Yossef Gilad Ben-Yossef (4): staging: ccree: remove sysfs if of deleted code staging: ccree: simplify access to struct device

[PATCH 1/4] staging: ccree: remove sysfs if of deleted code

2017-10-02 Thread Gilad Ben-Yossef
The ccree cycle count mechanism was removed in commit 7f821f0c6ffa ("staging: ccree: remove cycle count debug support") but the sysfs interface lingered on. Remove it now. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sysfs.c | 266

[PATCH 4/4] staging: ccree: simplify OOM handling

2017-10-02 Thread Gilad Ben-Yossef
Simplify handling of memory allocation failures and remove redundant log messages Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 11 -- drivers/staging/ccree/ssi_driver.c | 1 - drivers/staging/ccree/ssi_hash.c | 42

[PATCH 2/4] staging: ccree: simplify access to struct device

2017-10-02 Thread Gilad Ben-Yossef
Introduce a DEV macro to retrieve struct device from private data structure in preparation to replacing custom logging macros with proper dev_dbg and friends which require struct device. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 11 --- drivers/staging

[PATCH 3/4] staging: ccree: move to generic device log infra

2017-10-02 Thread Gilad Ben-Yossef
Move over from using macro wrappers around to printk to dev_err, dev_dbg and friends and clean up resulting fallout. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 226 ++ drivers/staging/ccree/ssi_buffer_mgr.c | 394

[PATCH v2 0/4] staging: ccree: logging related coding style fixes

2017-10-03 Thread Gilad Ben-Yossef
change. Patch set based upon commit 1cd5929ab675 ("staging: greybus: light: remove unnecessary error check") in the staging-next tree. Signed-off-by: Gilad Ben-Yossef Changes from v1: - Turn DEV macro into drvdats_to_dev inline function as suggested by Joe Perches. - Fix a compi

[PATCH v2 1/4] staging: ccree: remove sysfs if of deleted code

2017-10-03 Thread Gilad Ben-Yossef
The ccree cycle count mechanism was removed in commit 7f821f0c6ffa ("staging: ccree: remove cycle count debug support") but the sysfs interface lingered on. Remove it now. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sysfs.c | 266

Re: [PATCH 2/4] staging: ccree: simplify access to struct device

2017-10-03 Thread Gilad Ben-Yossef
On Mon, Oct 2, 2017 at 1:00 PM, Joe Perches wrote: > On Mon, 2017-10-02 at 10:03 +0100, Gilad Ben-Yossef wrote: >> Introduce a DEV macro to retrieve struct device from private >> data structure in preparation to replacing custom logging >> macros with proper dev_dbg and

[PATCH v2 2/4] staging: ccree: simplify access to struct device

2017-10-03 Thread Gilad Ben-Yossef
Introduce a function to retrieve struct device from private data structure in preparation to replacing custom logging macros with proper dev_dbg and friends which require struct device. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 11 --- drivers/staging

[PATCH v2 4/4] staging: ccree: simplify OOM handling

2017-10-03 Thread Gilad Ben-Yossef
Simplify handling of memory allocation failures and remove redundant log messages Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 11 -- drivers/staging/ccree/ssi_driver.c | 1 - drivers/staging/ccree/ssi_hash.c | 42

[PATCH v2 3/4] staging: ccree: move to generic device log infra

2017-10-03 Thread Gilad Ben-Yossef
Move over from using macro wrappers around to printk to dev_err, dev_dbg and friends and clean up resulting fallout. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 226 ++ drivers/staging/ccree/ssi_buffer_mgr.c | 394

Re: [PATCH] staging: ccree: local variable "dev" not required

2017-10-05 Thread Gilad Ben-Yossef
(unlikely(rc != 0)) { > - dev_err(dev, "ssi_ivgen_init failed\n"); > + dev_err(&plat_dev->dev, "ssi_ivgen_init failed\n"); > goto post_power_mgr_err; > } > > /* Allocate crypto algs */ > rc = s

Re: [PATCH] staging: ccree: Fix lines longer than 80 characters

2017-10-24 Thread Gilad Ben-Yossef
, re-write the code to be more readable by, for example, using a temp variable for the register address, and in doing so both making the code more readable as well as treating the symptom? Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, ca

[PATCH] staging: ccree: fix 64 bit scatter/gather DMA ops

2017-10-30 Thread Gilad Ben-Yossef
Fix a wrong offset used in splitting a 64 DMA address to MSB/LSB parts needed for scatter/gather HW descriptors causing operations relying on them to fail on 64 bit platforms. Fixes: c6f7f2f4591f ("staging: ccree: refactor LLI access macros") Reported-by: Stuart Yoder Signed-off-by:

[PATCH 0/3] staging: ccree: Fixes and cleanups

2017-10-31 Thread Gilad Ben-Yossef
Fixes and cleanups for 4.15 Gilad Ben-Yossef (3): staging: ccree: copy IV to DMAable memory staging: ccree: handle limiting of DMA masks staging: ccree: remove dead code drivers/staging/ccree/ssi_cipher.c | 20 ++-- drivers/staging/ccree/ssi_cipher.h | 1 + drivers

[PATCH 1/3] staging: ccree: copy IV to DMAable memory

2017-10-31 Thread Gilad Ben-Yossef
We are being passed an IV buffer from unknown origin, which may be stack allocated and thus not safe for DMA. Allocate a DMA safe buffer for the IV and use that instead. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 16 ++-- drivers/staging/ccree

[PATCH 3/3] staging: ccree: remove dead code

2017-10-31 Thread Gilad Ben-Yossef
The inflight_counter field is updated in a single location and never used. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 4 drivers/staging/ccree/ssi_driver.h | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b

[PATCH 2/3] staging: ccree: handle limiting of DMA masks

2017-10-31 Thread Gilad Ben-Yossef
Properly handle limiting of DMA masks based on device and bus capabilities. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging

Re: [PATCH 2/3] staging: ccree: handle limiting of DMA masks

2017-11-02 Thread Gilad Ben-Yossef
Hi, Thank you for the review. On Wed, Nov 1, 2017 at 1:09 PM, Dan Carpenter wrote: > On Tue, Oct 31, 2017 at 11:56:16AM +0000, Gilad Ben-Yossef wrote: >> >> - if (!dev->coherent_dma_mask) >> - dev->coherent_dma_mask = DMA_BIT_MASK(DMA_BIT

[PATCH v2 2/3] staging: ccree: handle limiting of DMA masks

2017-11-02 Thread Gilad Ben-Yossef
Properly handle limiting of DMA masks based on device and bus capabilities. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging

[PATCH v2 1/3] staging: ccree: copy IV to DMAable memory

2017-11-02 Thread Gilad Ben-Yossef
We are being passed an IV buffer from unknown origin, which may be stack allocated and thus not safe for DMA. Allocate a DMA safe buffer for the IV and use that instead. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 20 ++-- drivers/staging/ccree

[PATCH v2 0/3] staging: ccree: Fixes and cleanups

2017-11-02 Thread Gilad Ben-Yossef
Fixes and cleanups for 4.15 Changes from v1: - Move DMA mask code to before turning on clocks, based on feedback from Dan Carpenter. - Add missing kmalloc success check, as spotted by Dan Carpenter. Gilad Ben-Yossef (3): staging: ccree: copy IV to DMAable memory staging: ccree: handle

[PATCH v2 3/3] staging: ccree: remove dead code

2017-11-02 Thread Gilad Ben-Yossef
The inflight_counter field is updated in a single location and never used. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 4 drivers/staging/ccree/ssi_driver.h | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b

[PATCH 0/3] More code cleanups

2017-11-05 Thread Gilad Ben-Yossef
Additional code readability and simplification patches. These goes on top the previous patch set sent to the list. Gilad Ben-Yossef (3): staging: ccree: simplify error handling logic staging: ccree: simplify registers access staging: ccree: simplify ioread/iowrite drivers/staging/ccree

[PATCH 2/3] staging: ccree: simplify registers access

2017-11-05 Thread Gilad Ben-Yossef
The register offset calculation macro was taking a HW block base parameter that was not actually used. Simplify the whole thing by dropping it and rename the macro for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_regs.h | 15 drivers

[PATCH 1/3] staging: ccree: simplify error handling logic

2017-11-05 Thread Gilad Ben-Yossef
Turn the code sites that don't require any special handling on error return to a simple return. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/staging/

[PATCH 3/3] staging: ccree: simplify ioread/iowrite

2017-11-05 Thread Gilad Ben-Yossef
Registers ioread/iowrite operations were done via macros, sometime using a "magical" implicit parameter. Replace all register access with simple inline macros. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hal.h | 33 -- drivers/staging/ccree

Re: [PATCH 0/3] More code cleanups

2017-11-05 Thread Gilad Ben-Yossef
On Mon, Nov 6, 2017 at 9:38 AM, Greg Kroah-Hartman wrote: > On Mon, Nov 06, 2017 at 06:55:49AM +0000, Gilad Ben-Yossef wrote: >> Additional code readability and simplification patches. >> These goes on top the previous patch set sent to the list. > > Please label your 0/X

Re: [PATCH 3/3] staging: ccree: simplify ioread/iowrite

2017-11-06 Thread Gilad Ben-Yossef
On Mon, Nov 6, 2017 at 10:37 AM, Tobin C. Harding wrote: > On Mon, Nov 06, 2017 at 06:55:52AM +0000, Gilad Ben-Yossef wrote: >> Registers ioread/iowrite operations were done via macros, >> sometime using a "magical" implicit parameter. >> >> Replace all regi

[PATCH 0/8] staging: ccree: fixes and cleanups

2017-11-07 Thread Gilad Ben-Yossef
This is another batch of ccree fixes & cleanups. The first patch is a bug fix. All others are pure readability and coding style fixes. Gilad Ben-Yossef (8): staging: ccree: fix leak of import() after init() staging: ccree: use more readable func names staging: ccree: simplify AEAD u

[PATCH 3/8] staging: ccree: simplify AEAD using local var

2017-11-07 Thread Gilad Ben-Yossef
Make the code more readable by using a local variable for commonly use expression in the AEAD part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-07 Thread Gilad Ben-Yossef
Make the code more readable by using a local variable. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_pm.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index e1bc4c5..d60143c

[PATCH 2/8] staging: ccree: use more readable func names

2017-11-07 Thread Gilad Ben-Yossef
function naming scheme and shorten function name for better readabilty. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 32 +-- drivers/staging/ccree/ssi_buffer_mgr.c | 430 ++-- drivers/staging/ccree/ssi_buffer_mgr.h | 49 ++-- drivers

[PATCH 1/8] staging: ccree: fix leak of import() after init()

2017-11-07 Thread Gilad Ben-Yossef
already initialized. Fixes: commit 454527d0d94f ("staging: ccree: fix hash import/export") Cc: stable Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c

[PATCH 4/8] staging: ccree: simplify buf mgr using local vars

2017-11-07 Thread Gilad Ben-Yossef
Make the code more readable by using a local variables for commonly use expressions in the buffer manager part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a

[PATCH 8/8] staging: ccree: remove braces for single statement

2017-11-07 Thread Gilad Ben-Yossef
Remove necessary braces for single statement blocks to improve code readabilty. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree

[PATCH 5/8] staging: ccree: fold common code into function

2017-11-07 Thread Gilad Ben-Yossef
Fold common code copying MAC to/from a temp. buffer into an inline function instead of keeping multiple open coded versions of same. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 92 ++ 1 file changed, 38 insertions(+), 54 deletions

[PATCH 7/8] staging: ccree: remove compare to none zero

2017-11-07 Thread Gilad Ben-Yossef
The driver was full of code checking "if (x != 0)". Replace by "if (x)" for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 34 +++--- drivers/staging/ccree/ssi_buffer_mgr.c | 74 ++--- d

Re: [PATCH v2 1/3] staging: ccree: copy IV to DMAable memory

2017-11-08 Thread Gilad Ben-Yossef
Hi, On Wed, Nov 8, 2017 at 12:26 PM, Horia Geantă wrote: > On 11/2/2017 10:14 AM, Gilad Ben-Yossef wrote: >> We are being passed an IV buffer from unknown origin, which may be >> stack allocated and thus not safe for DMA. Allocate a DMA safe >> buffer for the IV and use th

Re: [PATCH 2/8] staging: ccree: use more readable func names

2017-11-08 Thread Gilad Ben-Yossef
Hi Dan, Thank you for reviewing the patch set. On Tue, Nov 7, 2017 at 12:30 PM, Dan Carpenter wrote: > > On Tue, Nov 07, 2017 at 09:39:58AM +, Gilad Ben-Yossef wrote: > > @@ -780,11 +766,10 @@ static inline int ssi_buffer_mgr_aead_chain_iv( > > unsigned int

Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-08 Thread Gilad Ben-Yossef
On Tue, Nov 7, 2017 at 12:43 PM, Dan Carpenter wrote: > On Tue, Nov 07, 2017 at 09:40:02AM +0000, Gilad Ben-Yossef wrote: >> --- a/drivers/staging/ccree/ssi_pm.c >> +++ b/drivers/staging/ccree/ssi_pm.c >> @@ -90,20 +90,24 @@ int cc_pm_resume(struct device *dev) >>

[PATCH v2 01/10] staging: ccree: fix leak of import() after init()

2017-11-09 Thread Gilad Ben-Yossef
already initialized. Fixes: commit 454527d0d94f ("staging: ccree: fix hash import/export") Cc: stable Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c

[PATCH v2 02/10] staging: ccree: make long func call sites readable

2017-11-09 Thread Gilad Ben-Yossef
scheme. Where required, realign parameters and add paranthesis for better code readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 32 +-- drivers/staging/ccree/ssi_buffer_mgr.c | 430 ++-- drivers/staging/ccree/ssi_buffer_mgr.h

[PATCH v2 05/10] staging: ccree: fold common code into function

2017-11-09 Thread Gilad Ben-Yossef
Fold common code copying MAC to/from a temp. buffer into an inline function instead of keeping multiple open coded versions of same. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 89 ++ 1 file changed, 37 insertions(+), 52 deletions

[PATCH v2 03/10] staging: ccree: simplify AEAD using local var

2017-11-09 Thread Gilad Ben-Yossef
Make the code more readable by using a local variable for commonly use expression in the AEAD part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH v2 07/10] staging: ccree: remove unneeded cast

2017-11-09 Thread Gilad Ben-Yossef
Remove unneeded cast of the return value of dev_get_drvdata() to struct ssi_drvdata * for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_pm.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ccree/ssi_pm.c b

[PATCH v2 00/10] staging: ccree: fixes and cleanups

2017-11-09 Thread Gilad Ben-Yossef
view. Gilad Ben-Yossef (10): staging: ccree: fix leak of import() after init() staging: ccree: make long func call sites readable staging: ccree: simplify AEAD using local var staging: ccree: simplify buf mgr using local vars staging: ccree: fold common code into function staging: c

[PATCH v2 10/10] staging: ccree: remove unused cc_base parameter

2017-11-09 Thread Gilad Ben-Yossef
Remove a common parameter named cc_base with the pointer to the mapped command registers which was used by the old register access macros that are not longer in use. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 2 +- drivers/staging/ccree/ssi_cipher.c | 12

[PATCH v2 04/10] staging: ccree: simplify buf mgr using local vars

2017-11-09 Thread Gilad Ben-Yossef
Make the code more readable by using a local variables for commonly use expressions in the buffer manager part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a

[PATCH v2 09/10] staging: ccree: remove braces for single statement

2017-11-09 Thread Gilad Ben-Yossef
Remove necessary braces for single statement blocks to improve code readabilty. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree

[PATCH v2 06/10] staging: ccree: simplify pm manager using local var

2017-11-09 Thread Gilad Ben-Yossef
Make the code more readable by using a local variable. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_pm.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index e1bc4c5..d60143c

[PATCH v2 08/10] staging: ccree: remove compare to none zero

2017-11-09 Thread Gilad Ben-Yossef
The driver was full of code checking "if (x != 0)". Replace by "if (x)" for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 28 +-- drivers/staging/ccree/ssi_buffer_mgr.c | 74 ++--- d

Re: [PATCH] staging: ccree: remove unused pointer cc_base

2017-11-09 Thread Gilad Ben-Yossef
t includes this fix but also deals with other occurrences of the same now no-longer needed cc_base variable just a second ago before checking my email... Sorry about that and thanks again. Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end

[PATCH 00/24] staging: ccree: more cleanup patches

2017-11-13 Thread Gilad Ben-Yossef
Another set of cleanup patches. This set goes on top of the previous fixes and cleanups patch set sent to the list. With this set of patches checkpatch now only reports one false warning and a warning on device tree string being undocumented. Gilad Ben-Yossef (24): staging: ccree: fix typos

[PATCH 01/24] staging: ccree: fix typos

2017-11-13 Thread Gilad Ben-Yossef
Fix a bunch of comment typos. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c| 2 +- drivers/staging/ccree/ssi_hash.h| 2 +- drivers/staging/ccree/ssi_ivgen.c | 2 +- drivers/staging/ccree/ssi_request_mgr.c | 2 +- drivers/staging/ccree

[PATCH 02/24] staging: ccree: alloc by instance not type

2017-11-13 Thread Gilad Ben-Yossef
Allocation by instance is preferred to allocation by type. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sram_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_sram_mgr.c b/drivers/staging/ccree/ssi_sram_mgr.c index 2263433

[PATCH 04/24] staging: ccree: remove MIN/MAX macros

2017-11-13 Thread Gilad Ben-Yossef
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 --- drivers/staging/ccree/ssi_aead.h | 2 +- drivers/staging/ccree/ssi_driver.h | 3 --- drivers/staging/ccree/ssi_hash.c | 2 +- 3 files

[PATCH 06/24] staging: ccree: remove unneeded empty lines

2017-11-13 Thread Gilad Ben-Yossef
Remove uneeded empty lines that crept in to code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 1 - drivers/staging/ccree/ssi_hash.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree

[PATCH 03/24] staging: ccree: remove unnecessary parentheses

2017-11-13 Thread Gilad Ben-Yossef
Remove unnecessary parentheses in if statements across the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 36 +- drivers/staging/ccree/ssi_buffer_mgr.c | 28 +- drivers/staging/ccree/ssi_cipher.c

[PATCH 05/24] staging: ccree: move logical cont. to 1st line

2017-11-13 Thread Gilad Ben-Yossef
Move logical continuations to first line for readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index

[PATCH 08/24] staging: ccree: make mem barrier per request

2017-11-13 Thread Gilad Ben-Yossef
The driver was issuing a write memory barrier per each HW descriptor written but these descriptors are written in groups and we really only need one per group. White at it, document memory barrier reason. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 13

[PATCH 07/24] staging: ccree: remove unneeded cast

2017-11-13 Thread Gilad Ben-Yossef
Remove uneeded cast from writel_relaxed parameter. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c

[PATCH 10/24] staging: ccree: document spinlock usage

2017-11-13 Thread Gilad Ben-Yossef
Document spinlock usage to protect against concurrent access to HW register which must occur a single request at a time. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b

[PATCH 09/24] staging: ccree: replace open coded loop with for

2017-11-13 Thread Gilad Ben-Yossef
Replace open coded register writing loop with a for. Further simplify code by using a local var to precompute the register address for readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions

[PATCH 11/24] staging: ccree: constify help string

2017-11-13 Thread Gilad Ben-Yossef
Make help string static const Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c index 5d39f15..8d50382 100644 --- a/drivers/staging

[PATCH 13/24] staging: ccree: Replace CONFIG_PM_RUNTIME with CONFIG_PM

2017-11-13 Thread Gilad Ben-Yossef
After commit b2b49ccbdd54 ("PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected") PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM. Signed-off-by: Gilad

[PATCH 12/24] staging: ccree: fix code indent

2017-11-13 Thread Gilad Ben-Yossef
Fix code ident not following the coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_sysfs.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree

[PATCH 14/24] staging: ccree: replace macro with inline func

2017-11-13 Thread Gilad Ben-Yossef
Replace GET_DMA_BUFFER_TYPE with an inline function variant with type checking. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b

[PATCH 16/24] staging: ccree: remove dead defs and decls

2017-11-13 Thread Gilad Ben-Yossef
Remove no longer definitions of enums and forward declaration of functions dealing with sysfs interface of the long removed ccree cycle counter. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sysfs.h | 23 --- 1 file changed, 23 deletions(-) diff --git a

[PATCH 15/24] staging: ccree: trim long lines for readability

2017-11-13 Thread Gilad Ben-Yossef
The ccree driver did not adhere to the kernel max 80 chars per line limit making the code hard to follow. Fix this by breaking long lines and in some cases, moving comments to a separate line from code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 152

[PATCH 17/24] staging: ccree: refactor code with local vars

2017-11-13 Thread Gilad Ben-Yossef
Refactor the queue handling loop using local variables for better code readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers

[PATCH 19/24] staging: ccree: rename long define for readability

2017-11-13 Thread Gilad Ben-Yossef
Rename the too long SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE to SSI_MAX_OPAD_KEYS_SIZE for better code readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers

[PATCH 18/24] staging: ccree: rename func for readability

2017-11-13 Thread Gilad Ben-Yossef
Rename the insanely long ssi_ahash_get_larval_digest_sram_addr() func to cc_larval_digest_addr() for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 7 +++ drivers/staging/ccree/ssi_hash.c | 13 ++--- drivers/staging/ccree/ssi_hash.h

[PATCH 20/24] staging: ccree: remove unneeded wrapper function

2017-11-13 Thread Gilad Ben-Yossef
Remove unneeded wrapper function to simplify code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index afdc44e

[PATCH 21/24] staging: ccree: remove unused field

2017-11-13 Thread Gilad Ben-Yossef
Field monitor_null_cycles of struct drvdata was not being used. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h index 7c266ff

[PATCH 22/24] staging: ccree: replace msleep with a completion

2017-11-13 Thread Gilad Ben-Yossef
. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 2 ++ drivers/staging/ccree/ssi_driver.h | 1 + drivers/staging/ccree/ssi_request_mgr.c | 7 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers

[PATCH 23/24] staging: ccree: use local vars for readability

2017-11-13 Thread Gilad Ben-Yossef
Refactor cc_map_aead_request() to use local vars for addresses for better readability of code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 64 +++--- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/drivers/staging

[PATCH 24/24] staging: ccree: drop unused macro

2017-11-13 Thread Gilad Ben-Yossef
The CC_REG_NAME macro is unused. Drop it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/drivers/staging/ccree/cc_hw_queue_defs.h index 2ae0f65..c5aaa79 100644 --- a

Re: [PATCH 07/24] staging: ccree: remove unneeded cast

2017-11-14 Thread Gilad Ben-Yossef
On Mon, Nov 13, 2017 at 5:41 PM, Joe Perches wrote: > > On Mon, 2017-11-13 at 14:45 +, Gilad Ben-Yossef wrote: > > Remove uneeded cast from writel_relaxed parameter. > [] > > diff --git a/drivers/staging/ccree/ssi_request_mgr.c > > b/drivers/stag

Re: [PATCH 00/24] staging: ccree: more cleanup patches

2017-11-14 Thread Gilad Ben-Yossef
ere you know the probable code flow of course). Any hints? -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru ___ deve

Re: [PATCH 00/24] staging: ccree: more cleanup patches

2017-11-14 Thread Gilad Ben-Yossef
On Tue, Nov 14, 2017 at 11:48 AM, Dan Carpenter wrote: > On Tue, Nov 14, 2017 at 11:33:20AM +0200, Gilad Ben-Yossef wrote: >> On Mon, Nov 13, 2017 at 8:33 PM, Dan Carpenter >> wrote: >> > These cleanups look nice. Thanks. >> > >> > I hope you do a mass

[PATCH] dt-bindings: add device tree binding for Arm TrustZone CryptoCell crypto engine

2017-11-15 Thread Gilad Ben-Yossef
The Arm TrustZone CryptoCell is a hardware security engine. This patch adds DT bindings for its Rich Execution Environment crypto engine. A driver supporting this device is already present in the staging tree. Signed-off-by: Gilad Ben-Yossef --- .../devicetree/bindings/crypto/arm

[PATCHi v2] dt-bindings: add device tree binding for Arm TrustZone CryptoCell crypto engine

2017-11-15 Thread Gilad Ben-Yossef
The Arm TrustZone CryptoCell is a hardware security engine. This patch adds DT bindings for its Rich Execution Environment crypto engine. A driver supporting this device is already present in the staging tree. Signed-off-by: Gilad Ben-Yossef Acked-by: Rob Herring --- Changes from v1: - Change

[PATCH 02/10] staging: ccree: remove unproven likely/unlikely

2017-12-03 Thread Gilad Ben-Yossef
The ccree code made a lot of use of likely/unlikely qualifiers without proven measurements showing any benefits. Remove them all until we see what is justified and what is not. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 57 ++-- drivers/staging/ccree

[PATCH 00/10] staging: ccree: cleanups & fixes

2017-12-03 Thread Gilad Ben-Yossef
Another batch of ccree work. Includes the usual mix of mostly cleanups and one fix. Also includes an updated TODO to reflect recent progress and removal of interim documentation of device tree strings as the official string and documentation thereof got blessed into the crypto tree. Gilad Ben

[PATCH 07/10] staging: ccree: update TODO list

2017-12-03 Thread Gilad Ben-Yossef
Update the ccree staging TODO list in light of recent work. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/staging/ccree/TODO b/drivers/staging/ccree/TODO index c9f5754..f44edcd

[PATCH 05/10] staging: ccree: remove braces for single statement blocks

2017-12-03 Thread Gilad Ben-Yossef
Remove braces from single statement if clause. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index e890cb6

[PATCH 04/10] staging: ccree: fix indentation of var assignment

2017-12-03 Thread Gilad Ben-Yossef
Fix indentation of var assignment split across lines for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index

[PATCH 06/10] staging: ccree: remove interim DT docs

2017-12-03 Thread Gilad Ben-Yossef
As proper DT bindings doc where submitted and ACKed, remove the interim one. Signed-off-by: Gilad Ben-Yossef --- .../devicetree/bindings/crypto/arm-cryptocell.txt | 27 -- 1 file changed, 27 deletions(-) delete mode 100644 drivers/staging/ccree/Documentation/devicetree

[PATCH 08/10] staging: ccree: NULLify backup_info when unused

2017-12-03 Thread Gilad Ben-Yossef
;) Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 9019615..7b484f1 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drive

[PATCH 03/10] staging: ccree: remove more unnecessary parentheses

2017-12-03 Thread Gilad Ben-Yossef
The removal of likely/unlikely unearthed some more unnecessary parentheses. Remove them for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 4 ++-- drivers/staging/ccree/ssi_driver.c | 6 +++--- drivers/staging/ccree/ssi_request_mgr.c | 2

[PATCH 01/10] staging: ccree: remove inline qualifiers

2017-12-03 Thread Gilad Ben-Yossef
The ccree drivers was marking a lot of big functions in C file as static inline for no good reason. Remove the inline qualifier from any but the few truly single line functions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 40

[PATCH 09/10] staging: ccree: fix AEAD func naming convention

2017-12-03 Thread Gilad Ben-Yossef
readable by switching to a simpler, consistent naming conventionfor all the function defined in the file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 544 ++--- drivers/staging/ccree/ssi_aead.h | 4 +- drivers/staging/ccree

[PATCH 10/10] staging: ccree: amend aead func def for readability

2017-12-03 Thread Gilad Ben-Yossef
Func definitions in the aead implementation were did not adhere to coding style. Fix them for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 141 ++- 1 file changed, 51 insertions(+), 90 deletions(-) diff --git a

Re: [PATCH] staging: ccree: ssi_aead: fixed all coding style warnings.

2017-12-06 Thread Gilad Ben-Yossef
s's tree and not Greg's staging-next tree which already contains fixes for many of the issues your patch is addressing. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats you

Re: [PATCH] staging: ccree: Uninitialized return in ssi_ahash_import()

2017-12-06 Thread Gilad Ben-Yossef
struct device *dev = drvdata_to_dev(ctx->drvdata); > struct ahash_req_ctx *state = ahash_request_ctx(req); > u32 tmp; > - int rc; > + int rc = 0; > > memcpy(&tmp, in, sizeof(u32)); > if (tmp != CC_EXPORT_MAGIC) { Acked-by: Gi

Re: [PATCH 01/10] staging: ccree: remove inline qualifiers

2017-12-06 Thread Gilad Ben-Yossef
On Mon, Dec 4, 2017 at 11:36 AM, Dan Carpenter wrote: > On Sun, Dec 03, 2017 at 01:58:12PM +0000, Gilad Ben-Yossef wrote: >> The ccree drivers was marking a lot of big functions in C file as >> static inline for no good reason. Remove the inline qualifier from >> any but the

  1   2   3   4   5   6   >