From patchwork Tue Mar 22 12:12:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolai Stange X-Patchwork-Id: 8641841 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 F2F939F294 for ; Tue, 22 Mar 2016 12:15:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F1A52035B for ; Tue, 22 Mar 2016 12:15:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F9E9202FE for ; Tue, 22 Mar 2016 12:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758492AbcCVMPq (ORCPT ); Tue, 22 Mar 2016 08:15:46 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35976 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758442AbcCVMOL (ORCPT ); Tue, 22 Mar 2016 08:14:11 -0400 Received: by mail-wm0-f67.google.com with SMTP id l68so29154191wml.3; Tue, 22 Mar 2016 05:14:11 -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:in-reply-to:references; bh=86C6eoU+5OlkLSpvF8Ra8u0w56dKwOUMpcR/0IrbAhU=; b=g2bCSipKeKve2NS9mvLaORUGK8NT+KS5ZEvniNdcDU/9kVwZkOv2ec5Sl+LlpsCGWX J5QzHBEp6gknnLQsjP4ZukHaUNE4pRarTGRumdrHPcA21LTVZusqNwyooONfwElmIYRa Llq10x7Z2/twriM6lp4WRtyBk1QCUPqF+ocimH1qm/OpheNcKUEc85tOGwTE0DFC7kyw Hhx8AFngpyLjurpVEh1taOkaUM5uaGEoW1k9U6BmvPIXEAFjFV87NcbcO52Lu+2uIA35 ODyC1ml+AdYH3bSkBoQdNWoDm7PZsV06NPXiqZs49eVtgd62YIkVIXnC1exEb25aS8bc fiNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=86C6eoU+5OlkLSpvF8Ra8u0w56dKwOUMpcR/0IrbAhU=; b=Zw35RfzTysoAit+ore6CzXkJbzSL3tcUFveMinwX4FK5HtFkVAk/V5YOcOFu2xibOx wGgZzkL0gvMFQfl1S0CLVAzQMXsdhzH8S0vxsn8j9vj9FuG66MqZgRUCBczb6SVze/7u rX4gKLofDmFTl7yu+Mn8KI2sVTYSY4kuusFsxky0nLjBnmQmbyyUJTYunHo8l1rMzLud IYEWZGh5wukuun0ZZAkTJdElwRlonaf4Yk6jpTvrSqSemPFGBmuIMbbo3y2iBKcrh20Q 5kU9O7z/Gy6lSjia4l+5seIgb2bSF8MO7Qbyklk06jlSv3POfTKVZW+c8irMGCKhhssO R0wg== X-Gm-Message-State: AD7BkJJChse1PnZG730o6dR3NodsHPZvH763SzoWxW8eaBzmS2QBKttQCRnuSyDovGp2rA== X-Received: by 10.28.10.18 with SMTP id 18mr18930969wmk.64.1458648850474; Tue, 22 Mar 2016 05:14:10 -0700 (PDT) Received: from localhost (x55b18fc0.dyn.telefonica.de. [85.177.143.192]) by smtp.gmail.com with ESMTPSA id n66sm17181217wmg.20.2016.03.22.05.14.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 05:14:10 -0700 (PDT) From: Nicolai Stange To: Herbert Xu , "David S. Miller" Cc: Tadeusz Struk , Michal Marek , Andrzej Zaborowski , Stephan Mueller , Arnd Bergmann , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolai Stange Subject: [PATCH v3 11/14] lib/mpi: mpi_read_raw_from_sgl(): purge redundant clearing of nbits Date: Tue, 22 Mar 2016 13:12:45 +0100 Message-Id: <1458648768-1469-12-git-send-email-nicstange@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1458648768-1469-1-git-send-email-nicstange@gmail.com> References: <1458648768-1469-1-git-send-email-nicstange@gmail.com> 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=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 In mpi_read_raw_from_sgl(), unsigned nbits is calculated as follows: nbits = nbytes * 8; and redundantly cleared later on if nbytes == 0: if (nbytes > 0) ... else nbits = 0; Purge this redundant clearing for the sake of clarity. Signed-off-by: Nicolai Stange --- lib/mpi/mpicoder.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c index 4ba0f23..27703aa 100644 --- a/lib/mpi/mpicoder.c +++ b/lib/mpi/mpicoder.c @@ -461,8 +461,6 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes) if (nbytes > 0) nbits -= count_leading_zeros(*(u8 *)(sg_virt(sgl) + lzeros)); - else - nbits = 0; nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); val = mpi_alloc(nlimbs);