From patchwork Fri Aug 25 13:47:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 9922071 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 01B666022E for ; Fri, 25 Aug 2017 13:47:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9401281C3 for ; Fri, 25 Aug 2017 13:47:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE340281F9; Fri, 25 Aug 2017 13:47:43 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 7904128174 for ; Fri, 25 Aug 2017 13:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932795AbdHYNrj (ORCPT ); Fri, 25 Aug 2017 09:47:39 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35024 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932813AbdHYNrg (ORCPT ); Fri, 25 Aug 2017 09:47:36 -0400 Received: by mail-wr0-f194.google.com with SMTP id a47so1528228wra.2 for ; Fri, 25 Aug 2017 06:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=BfPKRyi/+mF520EZ6o1PMpdhzk4LfKDonJmpWTYSAjA=; b=q6y1qITMwmM2cGTipYKLE4fSvbOYTVg6h9ijGioLtx0V4xSCXWdWvQPq9aTAKDo4LQ Maq3mtRjGSaBcLhqhgxYewUbrXVaopvpDJUiT+sRmjkjBfNbkSk7ducN21gpPyLWENh2 0rrqnjB9HplfZlikqjsx4ntIKMpWwqlmp2sYnXVU8px6w9i78r/WeDpdjykFJJXErWSf 0ut+eKGgHaU7LmKlhdZHYlGVtpfXjERAgZ3+lNRqjUfvRyJoVKWjpTUzhP7lvQAO+pQK SyYa0uBSUhEBWFuRzxSyoS4MikbWemgRK1D/O6PQAU1in6EjGaI0g7u6sD+dslrhj63Y bKJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=BfPKRyi/+mF520EZ6o1PMpdhzk4LfKDonJmpWTYSAjA=; b=lRj7quC7KvRFTl+eEhZQizgC92soaRPlAeMXbDgrxclEkf6n5Gj3A2urgOu6NPqrOW rWMaXx1xyebvHorjsvmHJ6N9Zt7kfO+1AuUF3gY1xdhXjwGNMgNFPuhNJqa7oh10zg0g VrCVAo93m0/RIyxaZdE1Cv3LVMhfJWDvltTggMmL8LrF3iWQZs8omlOVIbX1Kx/PQu7N Z7jLd31kgAPcQG14ddxwInpZi3nrZnTyT8c4okynMyybAYo3q1tQoKeNH6I4Vr5eoHFI n5aUOGDsUh7VA1+KmtS/ZEJaleFd+Gr9V1Zivdhtk4FBbUwASXoXITlTCGqKTrEvX2tP QKJw== X-Gm-Message-State: AHYfb5jafKOcLdqELiMt2seiJZU7jk+7Me2aFARts4aUVdWowyYYsHrD mwi1EErMtK2C7MoK X-Received: by 10.223.128.47 with SMTP id 44mr5859208wrk.175.1503668855069; Fri, 25 Aug 2017 06:47:35 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC232FCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:32fc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id l80sm1383105wrc.4.2017.08.25.06.47.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 06:47:28 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.89) (envelope-from ) id 1dlExJ-00029Z-El; Fri, 25 Aug 2017 15:47:25 +0200 From: Christian Lamparter To: linux-crypto@vger.kernel.org Cc: Herbert Xu , David Miller Subject: [PATCH 06/12] crypto: crypto4xx: fix dynamic_sa_ctl's sa_contents declaration Date: Fri, 25 Aug 2017 15:47:19 +0200 Message-Id: <575e998ebe72ea59e785263e11b2a44fb1c6d910.1503668705.git.chunkeey@googlemail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <71020bd2e3f4100c3c0668a13fdad9d22c8884a7.1503668705.git.chunkeey@googlemail.com> References: <71020bd2e3f4100c3c0668a13fdad9d22c8884a7.1503668705.git.chunkeey@googlemail.com> In-Reply-To: References: <71020bd2e3f4100c3c0668a13fdad9d22c8884a7.1503668705.git.chunkeey@googlemail.com> <85532949069735593f777489c6efcb6d1b08cdec.1503668705.git.chunkeey@googlemail.com> <7f51944084eef13bebe5f052557533bf6ade4ebc.1503668705.git.chunkeey@googlemail.com> <44b9527904d134982932cb807a3fa6f36093acbf.1503668705.git.chunkeey@googlemail.com> 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 The driver had a union dynamic_sa_contents in place that described the meaning of the bits in the sa_contents variable. Signed-off-by: Christian Lamparter --- drivers/crypto/amcc/crypto4xx_alg.c | 4 ++-- drivers/crypto/amcc/crypto4xx_sa.c | 12 ++++++------ drivers/crypto/amcc/crypto4xx_sa.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/crypto4xx_alg.c index 6da92321173b..867a9230cd3f 100644 --- a/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c @@ -149,7 +149,7 @@ static int crypto4xx_setkey_aes(struct crypto_ablkcipher *cipher, SA_NOT_COPY_HDR); crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), key, keylen); - sa->sa_contents = SA_AES_CONTENTS | (keylen << 2); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); sa->sa_command_1.bf.key_len = keylen >> 3; ctx->is_hash = 0; ctx->direction = DIR_INBOUND; @@ -219,7 +219,7 @@ static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm, SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, SA_NOT_COPY_HDR); ctx->direction = DIR_INBOUND; - sa->sa_contents = SA_HASH160_CONTENTS; + sa->sa_contents.w = SA_HASH160_CONTENTS; sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in; /* Need to zero hash digest in SA */ memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); diff --git a/drivers/crypto/amcc/crypto4xx_sa.c b/drivers/crypto/amcc/crypto4xx_sa.c index 69182e2cc3ea..78a8ca192d0d 100644 --- a/drivers/crypto/amcc/crypto4xx_sa.c +++ b/drivers/crypto/amcc/crypto4xx_sa.c @@ -40,9 +40,9 @@ u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx) union dynamic_sa_contents cts; if (ctx->direction == DIR_INBOUND) - cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; + cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; else - cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; + cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; offset = cts.bf.key_size + cts.bf.inner_size + cts.bf.outer_size @@ -66,9 +66,9 @@ u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx) union dynamic_sa_contents cts; if (ctx->direction == DIR_INBOUND) - cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; + cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; else - cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; + cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4; } @@ -77,9 +77,9 @@ u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx) union dynamic_sa_contents cts; if (ctx->direction == DIR_INBOUND) - cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; + cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; else - cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; + cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; return sizeof(struct dynamic_sa_ctl); } diff --git a/drivers/crypto/amcc/crypto4xx_sa.h b/drivers/crypto/amcc/crypto4xx_sa.h index 1352d58d4e34..537d548a20b7 100644 --- a/drivers/crypto/amcc/crypto4xx_sa.h +++ b/drivers/crypto/amcc/crypto4xx_sa.h @@ -169,7 +169,7 @@ union sa_command_1 { } __attribute__((packed)); struct dynamic_sa_ctl { - u32 sa_contents; + union dynamic_sa_contents sa_contents; union sa_command_0 sa_command_0; union sa_command_1 sa_command_1; } __attribute__((packed));