From patchwork Fri Feb 20 17:00:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Hicks X-Patchwork-Id: 5857261 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 77F95BF440 for ; Fri, 20 Feb 2015 17:00:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 934AB2041A for ; Fri, 20 Feb 2015 17:00:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABAAC20443 for ; Fri, 20 Feb 2015 17:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753921AbbBTRAT (ORCPT ); Fri, 20 Feb 2015 12:00:19 -0500 Received: from mail-ig0-f179.google.com ([209.85.213.179]:56749 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754407AbbBTRAS (ORCPT ); Fri, 20 Feb 2015 12:00:18 -0500 Received: by mail-ig0-f179.google.com with SMTP id l13so4548871iga.0 for ; Fri, 20 Feb 2015 09:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=S4w5iH/xLgsmxVk8uqwKjKlo6h2O1JunAwQ8ZTTc0H8=; b=Vkf5yatL2ibAN0ojDH/6KymdOpqbpPUsCpf8gOivPM6FXSCnYQTW89Xzvt6IZJObQn TlUpmy2i454c27QiODjiOWF1ptfEemsJTnC0y4HkwlaRC9yP0KFnOFgd5OS2MLfqLipT rVkRN9K9QTiABYhRDkyc7HxCgZ+iZs75PJAp4Tvqdz36QMYAMH6dR2iKavyR512zhhkB 83os/qUiN7S8+unjk5/MsUA68YH9tdsQmW9jOcjuvDlFT1Et/xeh66K9yy+eL1kMHR/a hvL2oBauMGUdppG6n6srslLUpryDUFSmeil3+CTXCMihvotsPBDfxghzQgxdslZduP72 wFNA== X-Received: by 10.107.6.157 with SMTP id f29mr14774252ioi.39.1424451617549; Fri, 20 Feb 2015 09:00:17 -0800 (PST) Received: from p1022build.eng-services.ca (cmr-208-97-87-171.cr.net.cable.rogers.com. [208.97.87.171]) by mx.google.com with ESMTPSA id w9sm1293015igl.0.2015.02.20.09.00.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Feb 2015 09:00:16 -0800 (PST) From: Martin Hicks To: Kim Phillips , Scott Wood , Kumar Gala Cc: linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org, Martin Hicks Subject: [PATCH 1/2] crypto: talitos: Clean ups and comment fixes for ablkcipher commands Date: Fri, 20 Feb 2015 12:00:09 -0500 Message-Id: <1424451610-5786-2-git-send-email-mort@bork.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1424451610-5786-1-git-send-email-mort@bork.org> References: <1424451610-5786-1-git-send-email-mort@bork.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 This just cleans up some of the initializers, and improves the comments should any other ablkcipher modes be added in the future. The header words 1 and 5 have more possibilities than just passing an IV. These are pointers to the Cipher Context in/out registers. Signed-off-by: Martin Hicks --- drivers/crypto/talitos.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 226654c..6b2a19a 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1377,11 +1377,9 @@ static int common_nonsnoop(struct talitos_edesc *edesc, int sg_count, ret; /* first DWORD empty */ - desc->ptr[0].len = 0; - to_talitos_ptr(&desc->ptr[0], 0); - desc->ptr[0].j_extent = 0; + desc->ptr[0] = zero_entry; - /* cipher iv */ + /* cipher context */ to_talitos_ptr(&desc->ptr[1], edesc->iv_dma); desc->ptr[1].len = cpu_to_be16(ivsize); desc->ptr[1].j_extent = 0; @@ -1444,14 +1442,12 @@ static int common_nonsnoop(struct talitos_edesc *edesc, edesc->dma_len, DMA_BIDIRECTIONAL); } - /* iv out */ + /* cipher context out */ map_single_talitos_ptr(dev, &desc->ptr[5], ivsize, ctx->iv, 0, DMA_FROM_DEVICE); /* last DWORD empty */ - desc->ptr[6].len = 0; - to_talitos_ptr(&desc->ptr[6], 0); - desc->ptr[6].j_extent = 0; + desc->ptr[6] = zero_entry; edesc->req.callback = callback; edesc->req.context = areq;