From patchwork Sat Oct 21 17:17:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10021457 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A5AE60375 for ; Sat, 21 Oct 2017 17:18:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3D8928A8C for ; Sat, 21 Oct 2017 17:18:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D77F828A92; Sat, 21 Oct 2017 17:18:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20EA428A8C for ; Sat, 21 Oct 2017 17:18:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932150AbdJURSg (ORCPT ); Sat, 21 Oct 2017 13:18:36 -0400 Received: from mout.web.de ([212.227.15.3]:58160 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149AbdJURSf (ORCPT ); Sat, 21 Oct 2017 13:18:35 -0400 Received: from [192.168.1.2] ([78.49.207.83]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LpwMZ-1dbJsf2Wk3-00fevc; Sat, 21 Oct 2017 19:17:26 +0200 Subject: [PATCH 3/3] crypto-ansi_cprng: Delete unnecessary blank lines From: SF Markus Elfring To: linux-crypto@vger.kernel.org, "David S. Miller" , Herbert Xu , Neil Horman Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <7c466b3a-ca32-b946-f36e-a963c31a2320@users.sourceforge.net> Date: Sat, 21 Oct 2017 19:17:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:1SJu8NUm4FpwVOdstw8R3r4WiSwGPTKfhNDdIwoL+sr7UPax3Qe skFisb5QzaKxtDFZ5WtOpqNDhQYM0XR86dHbA6SV4iOpfOBvHNRl1tqNQCiLwYd3H7/duvn LriJFPnB8uPSjsJPVmRsthiQ8YMCa/lNIe8PWayZx06K1C/pMT22PJZwJyGF/1S6JmE4QgO ePh0T3UICwAqJgoACF4bA== X-UI-Out-Filterresults: notjunk:1; V01:K0:pW9bPIKbZMU=:LcvuVd4LnqlwXtNAKxUZz/ aMTVi0avCjvHk8aLTKzHAT06uItVEBk5/GgfMuPVM3y9+zd1tEgUcn9c+tMhT7mRCGe8YAMUK 7dYoyv+Nkpg9nVwXyaDO83URJyX0yZR/LLYSHx+Jo85eg72wnMsh+4F6sS0EzWgNqlorh0r08 tDQuuJEC8E1JkJwBrW5MqCU90qyGk4Z610FZSGFk0Jfxg62zbS9ruUwS3sCkY4+T9NekWS2d/ fJ0DB3LKVvt980kY8oQepAq/x9abDTG5/Q0/eWai8oipM/yfG74Qqq/2635wFrTt9nZk8CZse Z3mGGUOq94Vw5owVXMznpBxad7bd7m/fzIfoyE7OTP0u6fOX8+oz/WMg4DnFgjk3JgHqmRjud /ciqlPDksTgXksrLDQu9HGfWJHcVdB/4Ok3feU69j7GjT1zsXzye6I/f/VPfvrC2iL6Q2Ha4O 5kcLEKrxlEd0CNk/ws68CAcnN9bKzhPOJ3dO3dJgFOu156AR7o6AaIw/iWttkrfoq7nJx+jNa hncrOsNJa4i2ASM+sRgxvPwTzUgsv02T440mTyu6pSG6Zpc7s7DtH6+Fq/CvRyqcSImLfmUga VtL5C5BzlelySsFyn6/3522bDADTRy2L0FVp6g3a+yABPqej7KE+KoEJNKRXeR2SKnY24JGl0 kwdUPvaMZt6uOj7thHcxETKT9gB0TRrx/libAe03ZwlbqoEsZDnPdWCC8E4Yd4z/nGiFCDNvD Kat50Vid6ZJy0D8cftb4n7n91FgBgyQJHxU4bjNrYIZaUjSwY42qmBxJNHspWR5NgpPSqRHD9 9uw4moKd2KeVU1cVjUVROEtPKYoqEiqo8l3QuLhlIGl9scky8k= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 21 Oct 2017 16:27:56 +0200 The script "checkpatch.pl" pointed information out like the following. CHECK: Please don't use multiple blank lines Thus fix the affected source code places. Signed-off-by: Markus Elfring --- crypto/ansi_cprng.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 3d805bf6d0c6..b9ec1975dde7 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -40,7 +40,6 @@ * for implementation details */ - struct prng_context { spinlock_t prng_lock; unsigned char rand_data[DEFAULT_BLK_SZ]; @@ -77,8 +76,8 @@ static void xor_vectors(unsigned char *in1, unsigned char *in2, for (i = 0; i < size; i++) out[i] = in1[i] ^ in2[i]; - } + /* * Returns DEFAULT_BLK_SZ bytes of random data per call * returns 0 if generation succeeded, <0 if something went wrong @@ -89,7 +88,6 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) unsigned char tmp[DEFAULT_BLK_SZ]; unsigned char *output = NULL; - dbgprint(KERN_CRIT "Calling _get_more_prng_bytes for context %p\n", ctx); @@ -101,7 +99,6 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) * This algorithm is a 3 stage state machine */ for (i = 0; i < 3; i++) { - switch (i) { case 0: /* @@ -156,10 +153,8 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) break; } - /* do the encryption */ crypto_cipher_encrypt_one(ctx->tfm, output, tmp); - } /* @@ -190,7 +185,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx, unsigned int byte_count = (unsigned int)nbytes; int err; - spin_lock_bh(&ctx->prng_lock); if (ctx->flags & PRNG_NEED_RESET) goto failure_indication; @@ -214,7 +208,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx, dbgprint(KERN_CRIT "getting %d random bytes for context %p\n", byte_count, ctx); - remainder: if (ctx->rand_data_valid == DEFAULT_BLK_SZ && _get_more_prng_bytes(ctx, do_cont_test) < 0)