From patchwork Sun Dec 7 12:26:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 5451611 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 7E6BC9F1C5 for ; Sun, 7 Dec 2014 12:27:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC0B920154 for ; Sun, 7 Dec 2014 12:27:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D91E22015A for ; Sun, 7 Dec 2014 12:27:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753216AbaLGM1Q (ORCPT ); Sun, 7 Dec 2014 07:27:16 -0500 Received: from ns.horizon.com ([71.41.210.147]:11414 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753214AbaLGM1H (ORCPT ); Sun, 7 Dec 2014 07:27:07 -0500 Received: (qmail 20836 invoked by uid 1000); 7 Dec 2014 07:26:53 -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 11/25] crypto: ansi_cprng - Eliminate unused PRNG_FIXED_SIZE flag Date: Sun, 7 Dec 2014 07:26:19 -0500 Message-Id: <3b88d963e7feb8e2ea0a0cc6588b90b422f1896e.1417951990.git.linux@horizon.com> 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 There's no way to set it, so it's dead code. Signed-off-by: George Spelvin --- crypto/ansi_cprng.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 74ec151e..f6a1e987 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -30,8 +30,7 @@ * Flags for the prng_context flags field */ -#define PRNG_FIXED_SIZE 0x1 -#define PRNG_NEED_RESET 0x2 +#define PRNG_NEED_RESET 0x1 /* * Note: DT is our counter value @@ -166,17 +165,6 @@ static int get_prng_bytes(u8 *buf, unsigned int nbytes, if (ctx->flags & PRNG_NEED_RESET) goto done; - /* - * If the FIXED_SIZE flag is on, only return whole blocks of - * pseudo random data - */ - err = -EINVAL; - if (ctx->flags & PRNG_FIXED_SIZE) { - if (nbytes < DEFAULT_BLK_SZ) - goto done; - byte_count = DEFAULT_BLK_SZ; - } - err = byte_count; dbgprint(KERN_CRIT "getting %d random bytes for context %p\n",