From patchwork Mon Jul 23 17:21:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10540643 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-2.web.codeaurora.org (Postfix) with ESMTP id 5638013BB for ; Mon, 23 Jul 2018 17:22:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38E5228B52 for ; Mon, 23 Jul 2018 17:22:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D8A328CDE; Mon, 23 Jul 2018 17:22:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B8DE628B52 for ; Mon, 23 Jul 2018 17:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388055AbeGWSYa (ORCPT ); Mon, 23 Jul 2018 14:24:30 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:32863 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388002AbeGWSYa (ORCPT ); Mon, 23 Jul 2018 14:24:30 -0400 Received: by mail-pg1-f195.google.com with SMTP id r5-v6so858028pgv.0 for ; Mon, 23 Jul 2018 10:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=76JSLhjGvkbuyXj5fz2HWlT1KumULqRFOLWBgI3VqUA=; b=W0lIx7J9h0o/vzPfL9L7UlpS4zurBV+28BTLsv+zIiEVt4UpzGTbxVjih/q6y0LZzp Pi8fWrRrrY03FOqA5QzTCsU+ESgsGC+QDGwGgI/ZlfrIm7BvU3HWFVnW1eFVdJ+7MsDE 1Qcn/yAuh443+WLZHvSD/csHR4Lag8fbcwvWkbsR3yLZcMUbdZb7YRljOgb1A6QJjVYg +36mww/Hz8lB5RjxyOMedQipylN1I0n2F26C3sRkuLgKuSQ1y9Rg6rMh9Hvm/MMDQgge 2tWESQtkkubTmMIZTGKdYkc2HyQceCx2cgRFPUjhxf9pjXAiSJb/E074o+cIz6s54mNQ WcCw== 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; bh=76JSLhjGvkbuyXj5fz2HWlT1KumULqRFOLWBgI3VqUA=; b=TjeY78aXo9pg5+SPxosewlwTNaASQhB3Mr9Bj9uxbT1trf8F9c4sXEro2pL66rk1Dx rOIA1P3mHvAWRuiKI82mwLfDqDrnADsG+ryXYyFAzf28BIueK8cEyp6FDl9kpjxrVgk/ oLq5COW+AxVlxEfgeyZw/FjxR0aCfK+wph4uXdB2s/d7QcT4ZZ/xk3IkaJ9nnW3y9ziV zJXnOuMUOojh7drGKPwgVs8xQy2RtB7BH2kjFlRWl48u4HFHG6YPxunGFhIoIM8zeu5q 6yAv8h8NW9/oObJbVtCkU79gO8Qqr8XIe59XSoTfml5OwFUEYxq1iBKEpN3awa/iGhgn 4skg== X-Gm-Message-State: AOUpUlEEswPT9hBgaFCgE4D0niQRO0+pY4kM6/bgmjveOemzyyyTEqC1 ONTOU6g/DWcG+Hx5ZA327mGF145N X-Google-Smtp-Source: AAOMgpeJZJpPsnpuu28vLVY51nQd4ULShbIgb0rYoqAjatbVMofYAVFocTn2jkjs9+TZZHe2g5extw== X-Received: by 2002:a65:520c:: with SMTP id o12-v6mr13171100pgp.15.1532366537222; Mon, 23 Jul 2018 10:22:17 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id v7-v6sm4351387pgh.57.2018.07.23.10.22.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 10:22:16 -0700 (PDT) From: Eric Biggers To: Herbert Xu , linux-crypto@vger.kernel.org Cc: Eric Biggers Subject: [PATCH] crypto: skcipher - remove unnecessary setting of walk->nbytes Date: Mon, 23 Jul 2018 10:21:29 -0700 Message-Id: <20180723172129.91742-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog 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 From: Eric Biggers Setting 'walk->nbytes = walk->total' in skcipher_walk_first() doesn't make sense because actually walk->nbytes needs to be set to the length of the first step in the walk, which may be less than walk->total. This is done by skcipher_walk_next() which is called immediately afterwards. Also walk->nbytes was already set to 0 in skcipher_walk_skcipher(), which is a better default value in case it's forgotten to be set later. Therefore, remove the unnecessary assignment to walk->nbytes. Signed-off-by: Eric Biggers --- crypto/skcipher.c | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/skcipher.c b/crypto/skcipher.c index 7d6a49fe3047..9f7d229827b5 100644 --- a/crypto/skcipher.c +++ b/crypto/skcipher.c @@ -436,7 +436,6 @@ static int skcipher_walk_first(struct skcipher_walk *walk) } walk->page = NULL; - walk->nbytes = walk->total; return skcipher_walk_next(walk); }