From patchwork Mon Mar 21 13:26:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolai Stange X-Patchwork-Id: 8633031 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 15C6CC0554 for ; Mon, 21 Mar 2016 13:28:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50A8120263 for ; Mon, 21 Mar 2016 13:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 805F3202E5 for ; Mon, 21 Mar 2016 13:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756015AbcCUN0z (ORCPT ); Mon, 21 Mar 2016 09:26:55 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33545 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755942AbcCUN0v (ORCPT ); Mon, 21 Mar 2016 09:26:51 -0400 Received: by mail-wm0-f66.google.com with SMTP id x188so21825653wmg.0; Mon, 21 Mar 2016 06:26:50 -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=Ej5uNMhrItL8vUMzHKgb16LL43OV241vOPCKoMlQ8SY=; b=sD9JYGjEECWbqjazhsN3EfazH0rcaaoyZsQdEtP9S9F+Mz6oEAmh3XwP04TC7J89Pg bbbowBVcK5G/t7fr+en1e17obsLk6mGnmU/it3AMD7Jsx6Za4m900gYQbPpM9y90LYho 9eOcmNUZaj8D/lKzGRfBM4r6wIVubx+cU4BLPC+fNkxINp/7kdezTCjaE5gF0nQ4hCA9 Kp86AeNHDLJzcoZybov3+eGqrFZYiWV2BSc10LlUKLwK1QLYuoSpOXNUbiAZh4MXFy8x oOPOb7I3kzaX6ZW0ySKHC+q41jlNjMmVPGoZQw0YhJa4To++ROTcoh4Cjh/hTvjZhwH8 aGcA== 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=Ej5uNMhrItL8vUMzHKgb16LL43OV241vOPCKoMlQ8SY=; b=KSn6bS/Dz5jtFh5scMY4OBFW//h6tBa35WpbGxRbqmFtZ2Y3d8PugsPdRren5ss6u+ k0H+Z5mb1YSxLhmQi0SlzllPBzeIuNTOwgptAlX9DizCLlWvQzCiz8y/pkSWvEjtiOpR 20DV32xNMlj9TxDmu3thEy9HXgDmgHygBE1wOWcVpXXux0Twe7xySRjOgJzS45FS7KjO HeeQc7nv6m147uUcAwlxrGRKa9bKq+W3gkmya5srgiQhW2rcNkY5kKwjzI9GAyT+tYhQ 9/AlYj72hBVCfpNkhg6vhKCxe6GAitmJIOIeHEiyUwupVxN2hZSRNUnKYWNsAPxww9QD CtCg== X-Gm-Message-State: AD7BkJLKsNmhiedIBNaEPMQPQR0a/TkW4NsnXGt4iWWtsZVI228hJHpIWvkCfEfdYjdm7A== X-Received: by 10.194.174.231 with SMTP id bv7mr30440597wjc.17.1458566809893; Mon, 21 Mar 2016 06:26:49 -0700 (PDT) Received: from localhost (x55b18fc0.dyn.telefonica.de. [85.177.143.192]) by smtp.gmail.com with ESMTPSA id y62sm12507070wmg.12.2016.03.21.06.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Mar 2016 06:26:49 -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 RESEND v2 11/14] lib/mpi: mpi_read_raw_from_sgl(): purge redundant clearing of nbits Date: Mon, 21 Mar 2016 14:26:12 +0100 Message-Id: <1458566775-5239-12-git-send-email-nicstange@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1458566775-5239-1-git-send-email-nicstange@gmail.com> References: <1458566775-5239-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, 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 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 add9e81..4cf8516 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);