Skip to content

Commit

Permalink
crypto: af_alg - bool type cosmetics
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Rubusch authored and herbertx committed Mar 30, 2020
1 parent 6e4e00d commit fcb90d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions crypto/af_alg.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,22 +821,22 @@ 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) {
err = af_alg_cmsg_send(msg, &con);
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;
Expand Down
6 changes: 3 additions & 3 deletions crypto/algif_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fcb90d5

Please sign in to comment.