* [PATCH] crypto: bool type cosmetics
@ 2020-03-15 17:42 Lothar Rubusch
2020-03-20 3:39 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Lothar Rubusch @ 2020-03-15 17:42 UTC (permalink / raw)
To: herbert, davem; +Cc: linux-crypto, l.rubusch
From d7e37962c530927952aa0f0601711fba75a3ddf2 Mon Sep 17 00:00:00 2001
From: Lothar Rubusch <l.rubusch@gmail.com>
Date: Sun, 15 Mar 2020 17:34:22 +0000
Subject: [PATCH] crypto: bool type cosmetics
When working with bool values the true and false definitions should be used
instead of 1 and 0.
Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
---
crypto/af_alg.c | 10 +++++-----
crypto/algif_hash.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 439367a8e95c..b1cd3535c525 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -821,8 +821,8 @@ int af_alg_sendmsg(struct socket *sock, struct
msghdr *msg, size_t size,
struct af_alg_tsgl *sgl;
struct af_alg_control con = {};
long copied = 0;
- bool enc = 0;
- bool init = 0;
+ bool enc = false;
+ bool init = false;
int err = 0;
if (msg->msg_controllen) {
@@ -830,13 +830,13 @@ int af_alg_sendmsg(struct socket *sock, struct
msghdr *msg, size_t size,
if (err)
return err;
- init = 1;
+ init = true;
switch (con.op) {
case ALG_OP_ENCRYPT:
- enc = 1;
+ enc = true;
break;
case ALG_OP_DECRYPT:
- enc = 0;
+ enc = false;
break;
default:
return -EINVAL;
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index 178f4cd75ef1..da1ffa4f7f8d 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -83,7 +83,7 @@ static int hash_sendmsg(struct socket *sock, struct
msghdr *msg,
goto unlock;
}
- ctx->more = 0;
+ ctx->more = false;
while (msg_data_left(msg)) {
int len = msg_data_left(msg);
@@ -211,7 +211,7 @@ static int hash_recvmsg(struct socket *sock,
struct msghdr *msg, size_t len,
}
if (!result || ctx->more) {
- ctx->more = 0;
+ ctx->more = false;
err = crypto_wait_req(crypto_ahash_final(&ctx->req),
&ctx->wait);
if (err)
@@ -436,7 +436,7 @@ static int hash_accept_parent_nokey(void *private,
struct sock *sk)
ctx->result = NULL;
ctx->len = len;
- ctx->more = 0;
+ ctx->more = false;
crypto_init_wait(&ctx->wait);
ask->private = ctx;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: bool type cosmetics
2020-03-15 17:42 [PATCH] crypto: bool type cosmetics Lothar Rubusch
@ 2020-03-20 3:39 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2020-03-20 3:39 UTC (permalink / raw)
To: Lothar Rubusch; +Cc: davem, linux-crypto
On Sun, Mar 15, 2020 at 06:42:07PM +0100, Lothar Rubusch wrote:
> >From d7e37962c530927952aa0f0601711fba75a3ddf2 Mon Sep 17 00:00:00 2001
> From: Lothar Rubusch <l.rubusch@gmail.com>
> Date: Sun, 15 Mar 2020 17:34:22 +0000
> Subject: [PATCH] crypto: bool type cosmetics
>
> When working with bool values the true and false definitions should be used
> instead of 1 and 0.
>
> Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
> ---
> crypto/af_alg.c | 10 +++++-----
> crypto/algif_hash.c | 6 +++---
> 2 files changed, 8 insertions(+), 8 deletions(-)
Sorry but your patch is corrupted. Please fix your mailer and
resubmit.
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:[~2020-03-20 3:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15 17:42 [PATCH] crypto: bool type cosmetics Lothar Rubusch
2020-03-20 3:39 ` 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).