Skip to content

Commit fcb90d5

Browse files
Rubuschherbertx
authored andcommitted
crypto: af_alg - bool type cosmetics
When working with bool values the true and false definitions should be used instead of 1 and 0. Hopefully I fixed my mailer and apologize for that. Signed-off-by: Lothar Rubusch <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 6e4e00d commit fcb90d5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crypto/af_alg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,22 +821,22 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
821821
struct af_alg_tsgl *sgl;
822822
struct af_alg_control con = {};
823823
long copied = 0;
824-
bool enc = 0;
825-
bool init = 0;
824+
bool enc = false;
825+
bool init = false;
826826
int err = 0;
827827

828828
if (msg->msg_controllen) {
829829
err = af_alg_cmsg_send(msg, &con);
830830
if (err)
831831
return err;
832832

833-
init = 1;
833+
init = true;
834834
switch (con.op) {
835835
case ALG_OP_ENCRYPT:
836-
enc = 1;
836+
enc = true;
837837
break;
838838
case ALG_OP_DECRYPT:
839-
enc = 0;
839+
enc = false;
840840
break;
841841
default:
842842
return -EINVAL;

crypto/algif_hash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
8383
goto unlock;
8484
}
8585

86-
ctx->more = 0;
86+
ctx->more = false;
8787

8888
while (msg_data_left(msg)) {
8989
int len = msg_data_left(msg);
@@ -211,7 +211,7 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
211211
}
212212

213213
if (!result || ctx->more) {
214-
ctx->more = 0;
214+
ctx->more = false;
215215
err = crypto_wait_req(crypto_ahash_final(&ctx->req),
216216
&ctx->wait);
217217
if (err)
@@ -436,7 +436,7 @@ static int hash_accept_parent_nokey(void *private, struct sock *sk)
436436

437437
ctx->result = NULL;
438438
ctx->len = len;
439-
ctx->more = 0;
439+
ctx->more = false;
440440
crypto_init_wait(&ctx->wait);
441441

442442
ask->private = ctx;

0 commit comments

Comments
 (0)