[PATCH] Staging: greybus: Fix multiple checks for null pointers

2018-01-07 Thread Sumit Pundir
Fixes the following coding style issue as noted by checkpatch.pl at multiple lines: Comparison to NULL could be written "!token" Signed-off-by: Sumit Pundir --- drivers/staging/greybus/camera.c | 16 1 file changed, 8 insertions(+), 8 deletions(-)

[PATCH] staging: sm750fb: Remove multiple blank lines

2018-01-07 Thread Marcelo Guzmán Lamperti
Remove multiple blank lines. Issue found by checkpatch. Signed-off-by: Marcelo Guzmán Lamperti --- drivers/staging/sm750fb/ddk750_sii164.c | 8 drivers/staging/sm750fb/ddk750_sii164.h | 2 -- 2 files changed, 10 deletions(-) diff --git

Re: [PATCH] Staging: iio: Prefer using BIT macro

2018-01-07 Thread Andy Shevchenko
On Sat, Jan 6, 2018 at 2:42 PM, Jonathan Cameron wrote: > On Thu, 4 Jan 2018 22:06:31 +0530 >> /* Setup Register Bit Designations (AD7152_REG_CHx_SETUP) */ >> -#define AD7152_SETUP_CAPDIFF (1 << 5) >> +#define AD7152_SETUP_CAPDIFF BIT(5) > > This is indeed a 1

[PATCH] Staging: gs_fpgaboot: remove FSF's mailing address from io.h

2018-01-07 Thread Shubham Kumaram
This patch removes FSF's mailing address issue from io.h found by checkpatch.pl tool. Signed-off-by: Shubham Kumaram --- drivers/staging/gs_fpgaboot/io.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/gs_fpgaboot/io.h

[PATCH] hyperv/netvsc: Delete two error messages for a failed memory allocation in netvsc_init_buf()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 7 Jan 2018 21:03:26 +0100 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

Re: [PATCH] staging: iio: light: Add breaks to lengthy lines

2018-01-07 Thread Jonathan Cameron
On Sun, 07 Jan 2018 08:42:27 -0800 Joe Perches wrote: > On Sun, 2018-01-07 at 16:28 +, Jonathan Cameron wrote: > > On Sun, 7 Jan 2018 15:08:01 + > > George Edward Bulmer wrote: > > > > > This fixes three instances of checkpatch warning: > >

Re: [PATCH] staging: iio: light: Add breaks to lengthy lines

2018-01-07 Thread Joe Perches
On Sun, 2018-01-07 at 16:28 +, Jonathan Cameron wrote: > On Sun, 7 Jan 2018 15:08:01 + > George Edward Bulmer wrote: > > > This fixes three instances of checkpatch warning: > > WARNING: line over 80 characters > > > > Signed-off-by: George Edward Bulmer

Re: [PATCH] staging: iio: light: Add breaks to lengthy lines

2018-01-07 Thread Jonathan Cameron
On Sun, 7 Jan 2018 15:08:01 + George Edward Bulmer wrote: > This fixes three instances of checkpatch warning: > WARNING: line over 80 characters > > Signed-off-by: George Edward Bulmer Applied, thanks, Jonathan > --- >

Re: [PATCH v2 01/27] staging: ccree: SPDXify driver

2018-01-07 Thread Philippe Ombredanne
Gilad, On Sun, Jan 7, 2018 at 11:13 AM, Gilad Ben-Yossef wrote: > On Wed, Jan 3, 2018 at 5:01 PM, Philippe Ombredanne > wrote: >> Gilad, >> >> On Wed, Jan 3, 2018 at 2:35 PM, Gilad Ben-Yossef wrote: >>> Replace verbatim GPL v2

[PATCH] staging: iio: light: Add breaks to lengthy lines

2018-01-07 Thread George Edward Bulmer
This fixes three instances of checkpatch warning: WARNING: line over 80 characters Signed-off-by: George Edward Bulmer --- drivers/staging/iio/light/tsl2x7x.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH v3 27/27] staging: ccree: add missing include

2018-01-07 Thread Gilad Ben-Yossef
Add the missing include of include file with function declarations. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/ccree/cc_debugfs.c b/drivers/staging/ccree/cc_debugfs.c index

[PATCH v3 26/27] staging: ccree: update TODO

2018-01-07 Thread Gilad Ben-Yossef
Update TODO to reflect work done Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/TODO b/drivers/staging/ccree/TODO index 6d8702b..b8e163d 100644 ---

[PATCH v3 22/27] staging: ccree: put pointer next to var name

2018-01-07 Thread Gilad Ben-Yossef
Put pointer next to var name as per coding style. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c

[PATCH v3 25/27] staging: ccree: remove unneeded includes

2018-01-07 Thread Gilad Ben-Yossef
Remove include files not needed for compilation. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_aead.c| 7 --- drivers/staging/ccree/cc_buffer_mgr.c | 6 -- drivers/staging/ccree/cc_cipher.c | 4 drivers/staging/ccree/cc_driver.c

[PATCH v3 20/27] staging: ccree: fix indentation of func params

2018-01-07 Thread Gilad Ben-Yossef
Fix indentation of some function params in hash code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 46 +--- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git

[PATCH v3 21/27] staging: ccree: fold common code into service func

2018-01-07 Thread Gilad Ben-Yossef
Fold common code in hash call into service functions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 339 ++- 1 file changed, 116 insertions(+), 223 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c

[PATCH v3 23/27] stating: ccree: fix allocation of void sized buf

2018-01-07 Thread Gilad Ben-Yossef
We were allocating buffers using sizeof(*struct->field) where field was type void. Fix it by having a local variable with the real type. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_ivgen.c| 9 -

[PATCH v3 17/27] staging: ccree: use array for double buffer

2018-01-07 Thread Gilad Ben-Yossef
The ccree hash code is using a double buffer to hold data for processing but manages the buffers and their associated data count in two separate fields and uses a predicate to chose which to use. Move to using a proper 2 members array for a much cleaner code. Signed-off-by: Gilad Ben-Yossef

[PATCH v3 18/27] staging: ccree: allocate hash bufs inside req ctx

2018-01-07 Thread Gilad Ben-Yossef
Move to allocating the buffers needed for requests as part of the request structure instead of malloc'ing each one on it's own, making for simpler (and more efficient) code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 68

[PATCH v3 19/27] staging: ccree: do not map bufs in ahash_init

2018-01-07 Thread Gilad Ben-Yossef
hash_init was mapping DMA memory that were then being unmap in hash_digest/final/finup callbacks, which is against the Crypto API usage rules (see discussion at https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30077.html) Fix it by moving all buffer mapping/unmapping or each Crypto

[PATCH v3 16/27] staging: ccree: remove unused field

2018-01-07 Thread Gilad Ben-Yossef
Remove unused struct field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index ee7370c..efea792 100644 ---

[PATCH v3 14/27] staging: ccree: handle end of sg list gracefully

2018-01-07 Thread Gilad Ben-Yossef
If we are asked for number of entries of an offset bigger than the sg list we should not crash. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 15/27] staging: ccree: use Makefile to include PM code

2018-01-07 Thread Gilad Ben-Yossef
Replace ugly ifdefs with some inline macros and Makefile magic for optionally including power management related code for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Makefile | 3 ++- drivers/staging/ccree/ssi_pm.c | 9

[PATCH v3 13/27] staging: ccree: check DMA pool buf !NULL before free

2018-01-07 Thread Gilad Ben-Yossef
If we ran out of DMA pool buffers, we get into the unmap code path with a NULL before. Deal with this by checking the virtual mapping is not NULL. Cc: sta...@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++- 1 file changed,

[PATCH v3 11/27] stating: ccree: revert "staging: ccree: fix leak of import() after init()"

2018-01-07 Thread Gilad Ben-Yossef
This reverts commit c5f39d07860c ("staging: ccree: fix leak of import() after init()") and commit aece09024414 ("staging: ccree: Uninitialized return in ssi_ahash_import()"). This is the wrong solution and ends up relying on uninitialized memory, although it was not obvious to me at the time.

[PATCH v3 12/27] staging: ccree: failing the suspend is not an error

2018-01-07 Thread Gilad Ben-Yossef
PM suspend returning a none zero value is not an error. It simply indicates a suspend is not advised right now so don't treat it as an error. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 8 +--- 1 file changed, 1 insertion(+), 7

[PATCH v3 10/27] staging: ccree: add backlog processing

2018-01-07 Thread Gilad Ben-Yossef
Crypto API tfm providers are required to provide a backlog service, if so indicated, that queues up requests in the case of the provider being busy and processing them later. The ccree driver did not provide this facility. Add it now. Signed-off-by: Gilad Ben-Yossef ---

[PATCH v3 06/27] staging: ccree: copy larval digest from RAM

2018-01-07 Thread Gilad Ben-Yossef
The ccree driver was using a DMA operation to copy larval digest from the ccree SRAM to RAM. Replace it with a simple memcpy. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 2 + drivers/staging/ccree/ssi_hash.c | 121

[PATCH v3 09/27] staging: ccree: break send_request and fix ret val

2018-01-07 Thread Gilad Ben-Yossef
The send_request() function was handling both synchronous and asynchronous invocations, but were not handling the asynchronous case, which may be called in an atomic context, properly as it was sleeping. Start to fix the problem by breaking up the two use cases to separate functions calling a

[PATCH v3 07/27] staging: ccree: tag debugfs init/exit func properly

2018-01-07 Thread Gilad Ben-Yossef
The debugfs global init and exit functions were missing __init and __exit tags, potentially wasting memory. Fix it by properly tagging them. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v3 08/27] staging: ccree: remove unused leftover field

2018-01-07 Thread Gilad Ben-Yossef
Remove the unused monitor_desc field. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index 7686e14..e1c01da

[PATCH v3 04/27] staging: ccree: remove GFP_DMA flag from mem allocs

2018-01-07 Thread Gilad Ben-Yossef
Remove bogus GFP_DMA flag from memory allocations. ccree driver does not operate over an ISA or similar limited bus. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_hash.c | 15 ++- 2 files changed, 7

[PATCH v3 03/27] staging: ccree: fold reg common defines into driver

2018-01-07 Thread Gilad Ben-Yossef
Fold the 2 macro defined in dx_reg_common.h into the file they are used in and delete the file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 4 ++-- drivers/staging/ccree/dx_reg_common.h | 13 - drivers/staging/ccree/ssi_driver.h

[PATCH v3 05/27] staging: ccree: pick alloc mem flags based on req flags

2018-01-07 Thread Gilad Ben-Yossef
The ccree driver was allocating memory using GFP_KERNEL flag always, ignoring the flags set in the crypto request. Fix it by choosing gfp flags based on crypto request flags. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 19 +++--

[PATCH v3 01/27] staging: ccree: SPDXify driver

2018-01-07 Thread Gilad Ben-Yossef
Replace verbatim GPL v2 copy with SPDX tag. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/Kconfig| 2 ++ drivers/staging/ccree/Makefile | 2 ++ drivers/staging/ccree/cc_crypto_ctx.h| 17 ++---

[PATCH v3 02/27] staging: ccree: fold hash defs into queue defs

2018-01-07 Thread Gilad Ben-Yossef
Fold the two remaining enum in hash defs into the queue defs that are using them and delete the hash defs include file. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 13 + drivers/staging/ccree/hash_defs.h| 23

[PATCH v3 00/27] staging: ccree: fixes and cleanups

2018-01-07 Thread Gilad Ben-Yossef
The usual combo of code cleanups and fixes. The highlights are: - Use SPDX for all driver copyright/license - Make ccree compliant with crypto API handling of backlog requests - Make ccree compliant with Crypto API rules of resource alloc/release - Settle on a single coherent file naming

Re: [PATCH] staging: ccree: shorten lengthy lines with breaks

2018-01-07 Thread Gilad Ben-Yossef
Hi George, On Sat, Jan 6, 2018 at 5:47 PM, George Edward Bulmer wrote: > This fixes five instances of checkpatch warning: > WARNING: line over 80 characters > Thank you for the patch. > Signed-off-by: George Edward Bulmer > --- >

Re: [PATCH v2 01/27] staging: ccree: SPDXify driver

2018-01-07 Thread Gilad Ben-Yossef
On Wed, Jan 3, 2018 at 5:01 PM, Philippe Ombredanne wrote: > Gilad, > > On Wed, Jan 3, 2018 at 2:35 PM, Gilad Ben-Yossef wrote: >> Replace verbatim GPL v2 copy with SPDX tag. >> >> Signed-off-by: Gilad Ben-Yossef > > > >> ---