linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] crypto: sa2ul: couple of fixes
@ 2020-08-25 13:31 Tero Kristo
  2020-08-25 13:31 ` [PATCH 1/2] dt-bindings: crypto: sa2ul: fix a DT binding check warning Tero Kristo
  2020-08-25 13:31 ` [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang Tero Kristo
  0 siblings, 2 replies; 6+ messages in thread
From: Tero Kristo @ 2020-08-25 13:31 UTC (permalink / raw)
  To: herbert, davem, linux-crypto

Hi,

Here are couple of fixes for sa2ul driver. Found via static checkers.

-Tero


--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] dt-bindings: crypto: sa2ul: fix a DT binding check warning
  2020-08-25 13:31 [PATCH 0/2] crypto: sa2ul: couple of fixes Tero Kristo
@ 2020-08-25 13:31 ` Tero Kristo
  2020-09-08 22:45   ` Rob Herring
  2020-08-25 13:31 ` [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang Tero Kristo
  1 sibling, 1 reply; 6+ messages in thread
From: Tero Kristo @ 2020-08-25 13:31 UTC (permalink / raw)
  To: herbert, davem, linux-crypto; +Cc: Rob Herring, devicetree

DT binding check produces a warning about bad cell size:

Documentation/devicetree/bindings/crypto/ti,sa2ul.example.dt.yaml: example-0: crypto@4e00000:reg:0: [0, 81788928, 0, 4608] is too long
	From schema: python3.6/site-packages/dtschema/schemas/reg.yaml

Fix this by reducing the address sizes for the example to 1 cell from
current 2.

Fixes: 2ce9a7299bf6 ("dt-bindings: crypto: Add TI SA2UL crypto accelerator documentation")
Reported-by: Rob Herring <robh@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml b/Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml
index 85ef69ffebed..1465c9ebaf93 100644
--- a/Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml
+++ b/Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml
@@ -67,7 +67,7 @@ examples:
 
     main_crypto: crypto@4e00000 {
         compatible = "ti,j721-sa2ul";
-        reg = <0x0 0x4e00000 0x0 0x1200>;
+        reg = <0x4e00000 0x1200>;
         power-domains = <&k3_pds 264 TI_SCI_PD_EXCLUSIVE>;
         dmas = <&main_udmap 0xc000>, <&main_udmap 0x4000>,
                <&main_udmap 0x4001>;
-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang
  2020-08-25 13:31 [PATCH 0/2] crypto: sa2ul: couple of fixes Tero Kristo
  2020-08-25 13:31 ` [PATCH 1/2] dt-bindings: crypto: sa2ul: fix a DT binding check warning Tero Kristo
@ 2020-08-25 13:31 ` Tero Kristo
  2020-08-26  5:23   ` Nathan Chancellor
  2020-09-11  6:55   ` Herbert Xu
  1 sibling, 2 replies; 6+ messages in thread
From: Tero Kristo @ 2020-08-25 13:31 UTC (permalink / raw)
  To: herbert, davem, linux-crypto

Clang detects a warning for an assignment that doesn't really do
anything. Fix this by removing the offending piece of code.

Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/crypto/sa2ul.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 5bc099052bd2..ff8bbdb4d235 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -1148,12 +1148,10 @@ static int sa_run(struct sa_req *req)
 			ret = sg_split(req->dst, mapped_dst_nents, 0, 1,
 				       &split_size, &dst, &dst_nents,
 				       gfp_flags);
-			if (ret) {
-				dst_nents = dst_nents;
+			if (ret)
 				dst = req->dst;
-			} else {
+			else
 				rxd->split_dst_sg = dst;
-			}
 		}
 	}
 
-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang
  2020-08-25 13:31 ` [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang Tero Kristo
@ 2020-08-26  5:23   ` Nathan Chancellor
  2020-09-11  6:55   ` Herbert Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Nathan Chancellor @ 2020-08-26  5:23 UTC (permalink / raw)
  To: Tero Kristo; +Cc: herbert, davem, linux-crypto

On Tue, Aug 25, 2020 at 04:31:06PM +0300, Tero Kristo wrote:
> Clang detects a warning for an assignment that doesn't really do
> anything. Fix this by removing the offending piece of code.
> 
> Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
> Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build

> ---
>  drivers/crypto/sa2ul.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
> index 5bc099052bd2..ff8bbdb4d235 100644
> --- a/drivers/crypto/sa2ul.c
> +++ b/drivers/crypto/sa2ul.c
> @@ -1148,12 +1148,10 @@ static int sa_run(struct sa_req *req)
>  			ret = sg_split(req->dst, mapped_dst_nents, 0, 1,
>  				       &split_size, &dst, &dst_nents,
>  				       gfp_flags);
> -			if (ret) {
> -				dst_nents = dst_nents;
> +			if (ret)
>  				dst = req->dst;
> -			} else {
> +			else
>  				rxd->split_dst_sg = dst;
> -			}
>  		}
>  	}
>  
> -- 
> 2.17.1
> 
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: crypto: sa2ul: fix a DT binding check warning
  2020-08-25 13:31 ` [PATCH 1/2] dt-bindings: crypto: sa2ul: fix a DT binding check warning Tero Kristo
@ 2020-09-08 22:45   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2020-09-08 22:45 UTC (permalink / raw)
  To: Tero Kristo; +Cc: herbert, linux-crypto, davem, devicetree

On Tue, 25 Aug 2020 16:31:05 +0300, Tero Kristo wrote:
> DT binding check produces a warning about bad cell size:
> 
> Documentation/devicetree/bindings/crypto/ti,sa2ul.example.dt.yaml: example-0: crypto@4e00000:reg:0: [0, 81788928, 0, 4608] is too long
> 	From schema: python3.6/site-packages/dtschema/schemas/reg.yaml
> 
> Fix this by reducing the address sizes for the example to 1 cell from
> current 2.
> 
> Fixes: 2ce9a7299bf6 ("dt-bindings: crypto: Add TI SA2UL crypto accelerator documentation")
> Reported-by: Rob Herring <robh@kernel.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied, thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang
  2020-08-25 13:31 ` [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang Tero Kristo
  2020-08-26  5:23   ` Nathan Chancellor
@ 2020-09-11  6:55   ` Herbert Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2020-09-11  6:55 UTC (permalink / raw)
  To: Tero Kristo; +Cc: davem, linux-crypto

On Tue, Aug 25, 2020 at 04:31:06PM +0300, Tero Kristo wrote:
> Clang detects a warning for an assignment that doesn't really do
> anything. Fix this by removing the offending piece of code.
> 
> Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
> Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  drivers/crypto/sa2ul.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-11  6:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 13:31 [PATCH 0/2] crypto: sa2ul: couple of fixes Tero Kristo
2020-08-25 13:31 ` [PATCH 1/2] dt-bindings: crypto: sa2ul: fix a DT binding check warning Tero Kristo
2020-09-08 22:45   ` Rob Herring
2020-08-25 13:31 ` [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang Tero Kristo
2020-08-26  5:23   ` Nathan Chancellor
2020-09-11  6:55   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).