From patchwork Tue Dec 2 08:39:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 5417881 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 D8D1E9F1CD for ; Tue, 2 Dec 2014 08:39:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08B6B2027D for ; Tue, 2 Dec 2014 08:39:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A10F2026C for ; Tue, 2 Dec 2014 08:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751061AbaLBIjW (ORCPT ); Tue, 2 Dec 2014 03:39:22 -0500 Received: from ns.horizon.com ([71.41.210.147]:16282 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750927AbaLBIjW (ORCPT ); Tue, 2 Dec 2014 03:39:22 -0500 Received: (qmail 18123 invoked by uid 1000); 2 Dec 2014 03:39:20 -0500 Date: 2 Dec 2014 03:39:20 -0500 Message-ID: <20141202083920.18122.qmail@ns.horizon.com> From: "George Spelvin" To: herbert@gondor.apana.org.au, nhorman@tuxdriver.com Subject: [PATCH 05/17] crypto: ansi_cprng - Add const annotations to hexdump() Cc: linux-crypto@vger.kernel.org, linux@horizon.com, smueller@chronox.de In-Reply-To: <20141202083314.17647.qmail@ns.horizon.com> 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 So I can pass the "input" variable to it. Signed-off-by: George Spelvin --- crypto/ansi_cprng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) I like to declare things const, and the lack of this in the prototype causes compiler complaints. diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 4856c84c7..1a0ba6a3 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -59,7 +59,7 @@ struct prng_context { static int dbg; -static void hexdump(char *note, unsigned char *buf, unsigned int len) +static void hexdump(char const *note, void const *buf, unsigned int len) { if (dbg) { printk(KERN_CRIT "%s", note); @@ -111,7 +111,7 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) */ input = ctx->DT; output = tmp; - hexdump("input stage 0: ", ctx->DT, DEFAULT_BLK_SZ); + hexdump("input stage 0: ", input, DEFAULT_BLK_SZ); break; case 1: /* @@ -122,8 +122,8 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) * anti-repetition compare. */ xor_block(tmp, ctx->V); - hexdump("input stage 1: ", ctx->V, DEFAULT_BLK_SZ); input = output = ctx->V; + hexdump("input stage 1: ", input, DEFAULT_BLK_SZ); break; case 2: /* @@ -150,8 +150,8 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test) * and encrypt that to obtain a new secret vector V */ xor_block(tmp, ctx->V); - hexdump("input stage 2: ", ctx->V, DEFAULT_BLK_SZ); input = output = ctx->V; + hexdump("input stage 2: ", input, DEFAULT_BLK_SZ); break; }