From patchwork Sun Dec 7 12:26:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Spelvin X-Patchwork-Id: 5451481 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 071D69F456 for ; Sun, 7 Dec 2014 12:27:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3295320154 for ; Sun, 7 Dec 2014 12:27:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49B3C20158 for ; Sun, 7 Dec 2014 12:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753185AbaLGM1E (ORCPT ); Sun, 7 Dec 2014 07:27:04 -0500 Received: from ns.horizon.com ([71.41.210.147]:64925 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753161AbaLGM1B (ORCPT ); Sun, 7 Dec 2014 07:27:01 -0500 Received: (qmail 20820 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 09/25] crypto: ansi_cprng - Make length types consistent Date: Sun, 7 Dec 2014 07:26:17 -0500 Message-Id: <2ec76417ed0624a9b6e6fc4168f6198fd6d402e3.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 The public crypto API uses "unsigned int", but the internals used a mixture of that and size_t, which are different sizes on 64 bits. This shuts up a GCC warning about printf format. Signed-off-by: George Spelvin --- crypto/ansi_cprng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 62b8f958..d4106e54 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -152,11 +152,11 @@ static int _get_more_prng_bytes(struct prng_context *ctx, bool cont_test) } /* Our exported functions */ -static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx, - bool do_cont_test) +static int get_prng_bytes(char *buf, unsigned int nbytes, + struct prng_context *ctx, bool do_cont_test) { unsigned char *ptr = buf; - unsigned int byte_count = (unsigned int)nbytes; + unsigned int byte_count = nbytes; int err; @@ -244,7 +244,7 @@ static void free_prng_context(struct prng_context *ctx) } static int reset_prng_context(struct prng_context *ctx, - unsigned char *key, size_t klen, + unsigned char *key, unsigned int klen, unsigned char *V, unsigned char *DT) { int ret;