From patchwork Sun Dec 7 12:26:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 5451441 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3E5729F1C5 for ; Sun, 7 Dec 2014 12:27:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6983D20155 for ; Sun, 7 Dec 2014 12:27:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 846B120154 for ; Sun, 7 Dec 2014 12:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174AbaLGM1D (ORCPT ); Sun, 7 Dec 2014 07:27:03 -0500 Received: from ns.horizon.com ([71.41.210.147]:19437 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753157AbaLGM1A (ORCPT ); Sun, 7 Dec 2014 07:27:00 -0500 Received: (qmail 20810 invoked by uid 1000); 7 Dec 2014 07:26:52 -0500 From: George Spelvin To: nhorman@tuxdriver.com, linux-crypto@vger.kernel.org Cc: smueller@chronox.de, herbert@gondor.apana.org.au, linux@horizon.com Subject: [PATCH v2 06/25] crypto: ansi_cprng - Make cont_test a bool Date: Sun, 7 Dec 2014 07:26:14 -0500 Message-Id: X-Mailer: git-send-email 2.1.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes no difference to the generated code, but I like to use bool where appropriate for documentation. Signed-off-by: George Spelvin --- crypto/ansi_cprng.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 2edac42e..730e0857 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -79,7 +79,7 @@ static void xor_vectors(unsigned char *in1, unsigned char *in2, * Returns DEFAULT_BLK_SZ bytes of random data per call * returns 0 if generation succeeded, <0 if something went wrong */ -static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) +static int _get_more_prng_bytes(struct prng_context *ctx, bool cont_test) { int i; unsigned char tmp[DEFAULT_BLK_SZ]; @@ -155,7 +155,7 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) /* Our exported functions */ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx, - int do_cont_test) + bool do_cont_test) { unsigned char *ptr = buf; unsigned int byte_count = (unsigned int)nbytes; @@ -322,7 +322,7 @@ static int cprng_get_random(struct crypto_rng *tfm, u8 *rdata, { struct prng_context *prng = crypto_rng_ctx(tfm); - return get_prng_bytes(rdata, dlen, prng, 0); + return get_prng_bytes(rdata, dlen, prng, false); } /* @@ -356,7 +356,7 @@ static int fips_cprng_get_random(struct crypto_rng *tfm, u8 *rdata, { struct prng_context *prng = crypto_rng_ctx(tfm); - return get_prng_bytes(rdata, dlen, prng, 1); + return get_prng_bytes(rdata, dlen, prng, true); } static int fips_cprng_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen) @@ -380,7 +380,7 @@ static int fips_cprng_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen) goto out; /* this primes our continuity test */ - rc = get_prng_bytes(rdata, DEFAULT_BLK_SZ, prng, 0); + rc = get_prng_bytes(rdata, DEFAULT_BLK_SZ, prng, false); prng->rand_data_valid = DEFAULT_BLK_SZ; out: