Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1776293ybh; Sun, 15 Mar 2020 10:45:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvGK1opXVEORfJIinqO4p0sYLLIqvl71PKb9iT87vVrRKSQNGlBUw/B+/rxynvVbwTC+CyR X-Received: by 2002:a9d:30c7:: with SMTP id r7mr19194613otg.289.1584294333155; Sun, 15 Mar 2020 10:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584294333; cv=none; d=google.com; s=arc-20160816; b=G2E9N3GEYuBTqmIG/0AN9JgklbEsZA3pUdw8olAimp1sXheF7WhnZl4vvmhYE6qhiB IbRZLqYqdejpPyCnyPhm/m2URm/EJi9y6JICyeGz0GFbl78F4J25+fPsci0ka4ZTNBIC liLOxBP9CscqRlY/byyqGsxwtHYhcttpZlUReFaepbYv24yF4Glq548F2P3kTW45s9ET pLlv4n9V92/k8J9XlXLXcZSFsIg1wt+Gnt2z4SUBrCOnwdx/goG68cFDX9yxL7enmwjx DfSxs9eSspS/SM+nZtLXk2WfQSqg6csVQf6tCXURgyoT/zs40SN6noJWCgrVGgB6ORsz kLzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=Iu+E5wDCASxZ/TQS6RG9jeBsAPsd78QxO09wdHNTWKc=; b=Luy3/Wz7rJ5H+tS/npg9c7SrXQrlPB80QHNjOSlTfRUuHGFWBDz9vRSJ5U1cTyY1Eh B8xnUj+UmzofOGXZvqWOpbW6cGeql9KacKAh1gpC24ph2TMJsWyrB2RVtdHbFKZOYceK TA+wBHJZ+VyyyagtdKMUdoD1shBdag2ZI8INnUtszAa0E9GvGBBRR584ogidzBJxxXiH QIKrMgwG4/y8CeTxt7ZY+sYf9HYCOyAF/vnWjQnFPjn5usBBaEtsILB0NzPMw4JThqMy SBYc0weXE8bu2T2KfM+7qNIch0b5wzYVGA+bHviqtv+GdrTUfX9CnP8wsgpQN64RJg0I 3F8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HyTVFmzM; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si9064895otn.216.2020.03.15.10.45.09; Sun, 15 Mar 2020 10:45:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HyTVFmzM; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728984AbgCORmo (ORCPT + 99 others); Sun, 15 Mar 2020 13:42:44 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:36125 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728979AbgCORmn (ORCPT ); Sun, 15 Mar 2020 13:42:43 -0400 Received: by mail-oi1-f195.google.com with SMTP id k18so15275855oib.3 for ; Sun, 15 Mar 2020 10:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=Iu+E5wDCASxZ/TQS6RG9jeBsAPsd78QxO09wdHNTWKc=; b=HyTVFmzMxdM7CzcXrl6JdXvebyBnUywGcXu20i7uFjZME0sh6Uvw+/vle0opPwvh5E DYIJEwJ+VfpAbKrBIf6q0mwVInxGnBwpM8Ls7J6dWt+DxjFsKyhDyrDiqFJasVbS4RzL NpD6wy+pSli7wyUt7B/EmQoPkxVIEk3wS21y9fQkmzn6E+ZixAFStpaenw/x/mPDBl0E tpZWNRx/o1yArn3XzzbE3lju83rPCv3wSXiSckiqBvE5u2r5glzD4R3F+1dwHObRytDd aADALm9QoQCw+aaBywGufOGzNNdkFBgpbA+JQrN6MGkTi941SS7v030zufGKXZmXXOof U1OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Iu+E5wDCASxZ/TQS6RG9jeBsAPsd78QxO09wdHNTWKc=; b=cxHQbL39YurTMduCYRbA4sEvMlzMKKhEV196iUITh0GOa9/RrCxPnfREhNOXfKfdFx 6Y5otyWux3PjMGovIijEmVJ3dG2jKQaBHU5iYfwulyjJEF7DxOZXm5cnfutzPRTQprDS WVtsY/POcJUzDcFsVCbdlmP59SDQAWB05/eGn/frRENucdjEG559fPrGbTe2FE7csV4A LZQnbcropaG2+Adt3uP3T6fT127FYPuCl2GtQKnXoi/7pxXeVuqNJugd0tT/kD/rzFT/ o6XntIscB+Go8xzd6ka6xM05FU3SVX1ScDa7uDMcq833Fvn40h1ti98P03uLBxNYr+Cb leRg== X-Gm-Message-State: ANhLgQ33cUMdyLSF0/rp9OCmFLD4J+i0MjvKR5hKmIytr1461v9HeS3D qH4ZSUkkBYbEoGfuYh0jEw9c3nvicXgo/ZKR/mge+QBwIWmMdx9p X-Received: by 2002:aca:47c8:: with SMTP id u191mr15287163oia.170.1584294163340; Sun, 15 Mar 2020 10:42:43 -0700 (PDT) MIME-Version: 1.0 From: Lothar Rubusch Date: Sun, 15 Mar 2020 18:42:07 +0100 Message-ID: Subject: [PATCH] crypto: bool type cosmetics To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, l.rubusch@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From d7e37962c530927952aa0f0601711fba75a3ddf2 Mon Sep 17 00:00:00 2001 From: Lothar Rubusch 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 --- 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