All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: ux500/hash - simplify if-if to if-else
@ 2022-04-08 14:23 Yihao Han
  2022-04-15  8:40 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Yihao Han @ 2022-04-08 14:23 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Julia Lawall, Linus Walleij,
	Yihao Han, Zhen Lei, YueHaibing, linux-crypto, linux-kernel
  Cc: kernel

Replace `if (!req_ctx->updated)` with `else` for simplification
and add curly brackets according to the kernel coding style:

"Do not unnecessarily use braces where a single statement will do."

...

"This does not apply if only one branch of a conditional statement is
a single statement; in the latter case use braces in both branches"

Please refer to:
https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 drivers/crypto/ux500/hash/hash_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index 5157c118d642..265ef3e96fdd 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -877,9 +877,7 @@ static int hash_dma_final(struct ahash_request *req)
 				__func__);
 			goto out;
 		}
-	}
-
-	if (!req_ctx->updated) {
+	} else {
 		ret = hash_setconfiguration(device_data, &ctx->config);
 		if (ret) {
 			dev_err(device_data->dev,
-- 
2.17.1


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

* Re: [PATCH] crypto: ux500/hash - simplify if-if to if-else
  2022-04-08 14:23 [PATCH] crypto: ux500/hash - simplify if-if to if-else Yihao Han
@ 2022-04-15  8:40 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2022-04-15  8:40 UTC (permalink / raw)
  To: Yihao Han
  Cc: David S. Miller, Julia Lawall, Linus Walleij, Zhen Lei,
	YueHaibing, linux-crypto, linux-kernel, kernel

On Fri, Apr 08, 2022 at 07:23:49AM -0700, Yihao Han wrote:
> Replace `if (!req_ctx->updated)` with `else` for simplification
> and add curly brackets according to the kernel coding style:
> 
> "Do not unnecessarily use braces where a single statement will do."
> 
> ...
> 
> "This does not apply if only one branch of a conditional statement is
> a single statement; in the latter case use braces in both branches"
> 
> Please refer to:
> https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html
> 
> Signed-off-by: Yihao Han <hanyihao@vivo.com>
> ---
>  drivers/crypto/ux500/hash/hash_core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 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] 2+ messages in thread

end of thread, other threads:[~2022-04-15  8:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 14:23 [PATCH] crypto: ux500/hash - simplify if-if to if-else Yihao Han
2022-04-15  8:40 ` Herbert Xu

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.