* [PATCH] crypto: cbc - fix coding style
@ 2021-04-01 7:31 Zhiqi Song
2021-04-09 7:28 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Zhiqi Song @ 2021-04-01 7:31 UTC (permalink / raw)
To: herbert, davem
Cc: linux-crypto, linux-kernel, wangzhou1, fanghao11, prime.zeng
Fixed following checkpatch error:
- do not use assignment in if condition
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
---
crypto/cbc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/cbc.c b/crypto/cbc.c
index 6c03e96..152d48d 100644
--- a/crypto/cbc.c
+++ b/crypto/cbc.c
@@ -140,7 +140,8 @@ static int crypto_cbc_decrypt_inplace(struct skcipher_walk *walk,
for (;;) {
fn(tfm, src, src);
- if ((nbytes -= bsize) < bsize)
+ nbytes -= bsize;
+ if (nbytes < bsize)
break;
crypto_xor(src, src - bsize, bsize);
src -= bsize;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: cbc - fix coding style
2021-04-01 7:31 [PATCH] crypto: cbc - fix coding style Zhiqi Song
@ 2021-04-09 7:28 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-04-09 7:28 UTC (permalink / raw)
To: Zhiqi Song
Cc: davem, linux-crypto, linux-kernel, wangzhou1, fanghao11, prime.zeng
On Thu, Apr 01, 2021 at 03:31:41PM +0800, Zhiqi Song wrote:
> Fixed following checkpatch error:
> - do not use assignment in if condition
>
> Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
> ---
> crypto/cbc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
This patch does not appear to improve the code.
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:[~2021-04-09 7:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 7:31 [PATCH] crypto: cbc - fix coding style Zhiqi Song
2021-04-09 7:28 ` 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).