diff mbox series

[2/2] crypto: sa2ul: fix compiler warning produced by clang

Message ID 20200825133106.21542-3-t-kristo@ti.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: sa2ul: couple of fixes | expand

Commit Message

Tero Kristo Aug. 25, 2020, 1:31 p.m. UTC
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(-)

Comments

Nathan Chancellor Aug. 26, 2020, 5:23 a.m. UTC | #1
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
Herbert Xu Sept. 11, 2020, 6:55 a.m. UTC | #2
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.
diff mbox series

Patch

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