From patchwork Wed Oct 14 19:15:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7397711 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 57ACB9F36A for ; Wed, 14 Oct 2015 19:16:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 867D920892 for ; Wed, 14 Oct 2015 19:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4145920883 for ; Wed, 14 Oct 2015 19:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753625AbbJNTQj (ORCPT ); Wed, 14 Oct 2015 15:16:39 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:38413 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbbJNTQi (ORCPT ); Wed, 14 Oct 2015 15:16:38 -0400 Received: by wieq12 with SMTP id q12so98185288wie.1; Wed, 14 Oct 2015 12:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=X9khRC4bs0gLKzok976JvT9nrFSd14I1ct78ci2qdf4=; b=nZvkGvyJjzQloxT4jY665QO3np80nTStxJIViBamTFv6seXgnwqqoYfRltfHZUX4J5 62ve7QNqb/bth8VTODr8cTmz7ARC2qTSblxtlEZ3ftBEAYLxVhisiMwODPXqq0aTOH14 RnfIjyXaZ97uxcWm17/3xs3zXrQ+LIc2kTwbQgd/ggj87gwpJ4NJ4q8bRE+ahouxddoS 7BXS2Oor7X3fCfMQZhACuag69S+F3lZsDa8rF2G8JVONQcf0L6jbP1vN99zLLxCP+AEA v+CEBofwex8PDIa9fyd4+0YuzA1OUPgkxwA3v2AKWF6ArOsPgW8RBa5LpK0VPduqqOYO 6IAA== X-Received: by 10.180.8.164 with SMTP id s4mr6607342wia.5.1444850197203; Wed, 14 Oct 2015 12:16:37 -0700 (PDT) Received: from Red.local (ANice-651-1-429-185.w83-201.abo.wanadoo.fr. [83.201.253.185]) by smtp.googlemail.com with ESMTPSA id go5sm8321197wib.3.2015.10.14.12.16.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Oct 2015 12:16:36 -0700 (PDT) From: LABBE Corentin To: ameenali023@gmail.com, bp@alien8.de, clabbe.montjoie@gmail.com, dan.carpenter@oracle.com, davem@davemloft.net, firogm@gmail.com, herbert@gondor.apana.org.au, hpa@zytor.com, mingo@redhat.com, minipli@googlemail.com, smueller@chronox.de, tglx@linutronix.de, tim.c.chen@linux.intel.com, x86@kernel.org Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: x86: Remove duplicate define of SHA1_DIGEST_SIZE Date: Wed, 14 Oct 2015 21:15:51 +0200 Message-Id: <1444850171-17931-1-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.9 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 sha x86 crypto code use two define for the same thing: NUM_SHA1_DIGEST_WORDS and SHA1_DIGEST_LENGTH Replace them by SHA1_DIGEST_SIZE/4 Signed-off-by: LABBE Corentin --- arch/x86/crypto/sha-mb/sha1_mb.c | 2 +- arch/x86/crypto/sha-mb/sha_mb_ctx.h | 1 - arch/x86/crypto/sha-mb/sha_mb_mgr.h | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/crypto/sha-mb/sha1_mb.c b/arch/x86/crypto/sha-mb/sha1_mb.c index a841e97..791cbfa 100644 --- a/arch/x86/crypto/sha-mb/sha1_mb.c +++ b/arch/x86/crypto/sha-mb/sha1_mb.c @@ -104,7 +104,7 @@ static asmlinkage struct job_sha1* (*sha1_job_mgr_get_comp_job)(struct sha1_mb_m inline void sha1_init_digest(uint32_t *digest) { - static const uint32_t initial_digest[SHA1_DIGEST_LENGTH] = {SHA1_H0, + static const uint32_t initial_digest[SHA1_DIGEST_SIZE / 4] = {SHA1_H0, SHA1_H1, SHA1_H2, SHA1_H3, SHA1_H4 }; memcpy(digest, initial_digest, sizeof(initial_digest)); } diff --git a/arch/x86/crypto/sha-mb/sha_mb_ctx.h b/arch/x86/crypto/sha-mb/sha_mb_ctx.h index e36069d..9fd36eb5 100644 --- a/arch/x86/crypto/sha-mb/sha_mb_ctx.h +++ b/arch/x86/crypto/sha-mb/sha_mb_ctx.h @@ -94,7 +94,6 @@ enum hash_ctx_error { /* Hash Constants and Typedefs */ -#define SHA1_DIGEST_LENGTH 5 #define SHA1_LOG2_BLOCK_SIZE 6 #define SHA1_PADLENGTHFIELD_SIZE 8 diff --git a/arch/x86/crypto/sha-mb/sha_mb_mgr.h b/arch/x86/crypto/sha-mb/sha_mb_mgr.h index 08ad1a9..3ff337c 100644 --- a/arch/x86/crypto/sha-mb/sha_mb_mgr.h +++ b/arch/x86/crypto/sha-mb/sha_mb_mgr.h @@ -54,11 +54,9 @@ #ifndef __SHA_MB_MGR_H #define __SHA_MB_MGR_H - +#include #include -#define NUM_SHA1_DIGEST_WORDS 5 - enum job_sts { STS_UNKNOWN = 0, STS_BEING_PROCESSED = 1, STS_COMPLETED = 2, @@ -69,7 +67,7 @@ enum job_sts { STS_UNKNOWN = 0, struct job_sha1 { u8 *buffer; u32 len; - u32 result_digest[NUM_SHA1_DIGEST_WORDS] __aligned(32); + u32 result_digest[SHA1_DIGEST_SIZE / 4] __aligned(32); enum job_sts status; void *user_data; };