From patchwork Thu May 26 11:05:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolai Stange X-Patchwork-Id: 9136923 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.web.codeaurora.org (Postfix) with ESMTP id 9CCEE6075C for ; Thu, 26 May 2016 11:05:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E92F27B90 for ; Thu, 26 May 2016 11:05:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 836EB280E5; Thu, 26 May 2016 11:05:51 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 34BB527B90 for ; Thu, 26 May 2016 11:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753359AbcEZLFu (ORCPT ); Thu, 26 May 2016 07:05:50 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35606 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753191AbcEZLFt (ORCPT ); Thu, 26 May 2016 07:05:49 -0400 Received: by mail-wm0-f67.google.com with SMTP id e3so4255725wme.2; Thu, 26 May 2016 04:05:48 -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=hisCYuZviAMOG/6ipFlZGcTy44Ra5nr6Q4vlSpdZTWY=; b=jPvFcSIATvUCBUL3tQkPXnOekN0ussnqjnSKr9/0XRepktOPILil7CW9K4Nm5TYivj tj0PTd2HrobJyxWvF7hZkt1InkP23UsPMqXROD75yL/959T1L4L7fnzP5tUk8mJQq+c9 NaAG8nnAoq9AAy+E+rjnJn1VpJYuH7BdFShwW56aUGG9WbE1T/k+9G7t0v/xcBYd+by7 y9bNAHl1YE5GEcO0hvx5SPU+TSXbDqo/4rmrYYB3AVg7IwG0C6pTpLQpsmXBCqyn+Is4 D6yaFUcuHxbnTJ/bRLMfpaCz4PEW7SnLTCToiiCvE4GkzUnUH638+Fur2ClhDgvxkDXK Hc6g== 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; bh=hisCYuZviAMOG/6ipFlZGcTy44Ra5nr6Q4vlSpdZTWY=; b=hv64oRQfSObyIhMEoszQ3blMoU5FLuva+s2uyTBcx4ZCRd1yBdSqzHo1FEUuwW9z22 BofkpTqtyqUcOo2Wdu3xi/HwQOngKVNnU8rzX1TcI0VQPs4KonKf1GyPfIE8PaQKI98W JNq5lRA5b/yYXTCvuRmgwh35pLjhBjirlUV6qt3v9Wwn5L1ytosdwyzcpYQd0djZUC71 yp2sRrFYuSBtvdkGQv7yo0JT+pQ297AI7C4gs1YRDoV431z3bmrBcilOEe8H6VRzq3xq Q/vyQCiFp4+uLsknmJx9XppGoMsuT0FVSIxYaXfr/+efi3Nhp6BgIDB+lucuH4V3xhyW XwfQ== X-Gm-Message-State: ALyK8tIDHQqDd4GHFVJ12ATcSgziklW6QdC5wJ0lkSzSH35kgHIvztvk9ekYv28Sdf8I6w== X-Received: by 10.28.146.73 with SMTP id u70mr3291864wmd.42.1464260747597; Thu, 26 May 2016 04:05:47 -0700 (PDT) Received: from localhost (x4e361809.dyn.telefonica.de. [78.54.24.9]) by smtp.gmail.com with ESMTPSA id n66sm2967531wmn.7.2016.05.26.04.05.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 04:05:47 -0700 (PDT) From: Nicolai Stange To: Herbert Xu Cc: Tadeusz Struk , Michal Marek , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolai Stange Subject: [PATCH 1/2] lib/mpi: mpi_read_raw_data(): purge redundant clearing of nbits Date: Thu, 26 May 2016 13:05:31 +0200 Message-Id: <1464260732-4446-1-git-send-email-nicstange@gmail.com> X-Mailer: git-send-email 2.8.2 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 In mpi_read_raw_data(), 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 --- Applicable to linux-next-20160525. lib/mpi/mpicoder.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c index 747606f..c160393 100644 --- a/lib/mpi/mpicoder.c +++ b/lib/mpi/mpicoder.c @@ -51,8 +51,6 @@ MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes) } if (nbytes > 0) nbits -= count_leading_zeros(buffer[0]); - else - nbits = 0; nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); val = mpi_alloc(nlimbs);