From patchwork Wed May 6 09:18:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6347891 Return-Path: X-Original-To: patchwork-linux-scsi@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 8E1479F1C2 for ; Wed, 6 May 2015 09:19:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F6912022A for ; Wed, 6 May 2015 09:19:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01F3020212 for ; Wed, 6 May 2015 09:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751147AbbEFJTU (ORCPT ); Wed, 6 May 2015 05:19:20 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:35832 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbbEFJTQ (ORCPT ); Wed, 6 May 2015 05:19:16 -0400 Received: by pdbqd1 with SMTP id qd1so4209921pdb.2; Wed, 06 May 2015 02:19:16 -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=FZOqqXOSt+e/XU91ylaxAT1rsF9Kj5rFaXNJ5RnHeAc=; b=Vb2+B9HeyGNYtX869ZkCNAp4JBLg85Ork02LO8DqpGuATDbBUaWzYc1rUfPpgD4KqH djHdPwXDi/oFIz1VhSJk8tWA3eMkiXLGsCIRAagCNaQB6Hqtv1vT66De7vP9LSR0Y4lU mOfyLlnhA1kozV0udMHgTzwwisKiZPvM0bwoUWgDFoazXRSe4d2YirnJO22H1Ym9XOr+ x/GFu2LX8MnfiG7vghoJplKxJaJofpFSkc9OYxWvXGlnXZjQqsmzqk6uRVBc8OrW1+GR FVXY4VoCBO6pXmOeFD+qd+KQKEV0R2QL1V7d3RdeCik7xWrEudvq7KBes0HxQMayQWaz ks5w== X-Received: by 10.70.140.108 with SMTP id rf12mr58723236pdb.140.1430903956320; Wed, 06 May 2015 02:19:16 -0700 (PDT) Received: from localhost.localdomain (KD106168100169.ppp-bb.dion.ne.jp. [106.168.100.169]) by mx.google.com with ESMTPSA id fs16sm1327903pdb.12.2015.05.06.02.19.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 May 2015 02:19:15 -0700 (PDT) From: Akinobu Mita To: target-devel@vger.kernel.org Cc: Akinobu Mita , Tim Chen , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, Nicholas Bellinger , Sagi Grimberg , "Martin K. Petersen" , Christoph Hellwig , "James E.J. Bottomley" , linux-scsi@vger.kernel.org Subject: [PATCH -next] crct10dif: remove extra function call in crc_t10dif() and crc_t10dif_update() Date: Wed, 6 May 2015 18:18:51 +0900 Message-Id: <1430903931-4465-1-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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=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 Calling crypto_shash_import() in crc_t10dif() and crc_t10dif_update() is overkill as the existing crct10dif modules (crct10dif-generic and crct10dif-pclmul) don't require. We also do the same thing with crc32c() in lib/libcrc32.c. Signed-off-by: Akinobu Mita Cc: Tim Chen Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Nicholas Bellinger Cc: Sagi Grimberg Cc: "Martin K. Petersen" Cc: Christoph Hellwig Cc: "James E.J. Bottomley" Cc: target-devel@vger.kernel.org Cc: linux-scsi@vger.kernel.org --- lib/crc-t10dif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/crc-t10dif.c b/lib/crc-t10dif.c index d775737..1ad33e5 100644 --- a/lib/crc-t10dif.c +++ b/lib/crc-t10dif.c @@ -32,9 +32,8 @@ __u16 crc_t10dif_update(__u16 crc, const unsigned char *buffer, size_t len) desc.shash.tfm = crct10dif_tfm; desc.shash.flags = 0; + *(__u16 *)desc.ctx = crc; - err = crypto_shash_import(&desc.shash, &crc); - BUG_ON(err); err = crypto_shash_update(&desc.shash, buffer, len); BUG_ON(err);