From patchwork Tue Aug 22 16:22:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PrasannaKumar Muralidharan X-Patchwork-Id: 9915705 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 A4A7B603F9 for ; Tue, 22 Aug 2017 16:22:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88FAB28889 for ; Tue, 22 Aug 2017 16:22:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D786288CA; Tue, 22 Aug 2017 16:22: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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 1E20728889 for ; Tue, 22 Aug 2017 16:22:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751115AbdHVQWu (ORCPT ); Tue, 22 Aug 2017 12:22:50 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36835 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbdHVQWt (ORCPT ); Tue, 22 Aug 2017 12:22:49 -0400 Received: by mail-pg0-f65.google.com with SMTP id y129so27752574pgy.3 for ; Tue, 22 Aug 2017 09:22:49 -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=FGtHtMuqHDRutt8sB0yfUJLCXzncQyeaOOPIizfCfhQ=; b=G5VgjC68IjjNf1Cqny1Gm3PIeZzJV2OHhqSt3Kus+th2lt4BedMhZnbxUCGc8A0aul A0J3SKQMKyjIClGqAnpY2sSCK3OwaTdWgiJB+F0sG1Wn0L8+cRopMeOsBQZBgAGzSTQs MSW0JMPq087c46LqJ/BVLDjpbuBogM3aW5qdJxf9a9+6J634D7ZWEPVeMBAdISrxsdrD 916iXBrAZtRju2Pq1t6661rTsUcbwJsnew1xYtihKQmquRcVWNW9goRv0914Y4t+aJvv 4LH8hLYvEQjzqhtdCcwCAvKvf1HV8wVeTj65FkxnUv6sw2ez/KG4tE51omYMCjEzf/+K HzYQ== 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=FGtHtMuqHDRutt8sB0yfUJLCXzncQyeaOOPIizfCfhQ=; b=B6/bekWFIhd/RpK4Ryl3OC5ZHHnJPz7BpIymi/aSboI5GoLyAhwB6v1SzJ13MjjIkh Zg2qA1M4yMVpf7SqZEy09r9WD5eoit95g5XohtWZe9i7wB6fz+fTtpfHopBR5ztFrsZ0 HsYuDcHgUEa1gqfa2R2LInxNOueiQt3Ts5ZdBvR+RZsm1ug9DFXQOGzd2DQih8NnIBY0 n/Zo86x0iLSQ00JVAZKPwF8QycRBX86LutX5+CwQxQBAsts5RucR7esQW3VhB3ffGTAo 8fsXQ0wu4Ui1iEAN3Uv/zrbQ0hskhCDnwEixwwVpj69PBh8Ro+i3Q+UIH6/b8k7YuWVb U5sA== X-Gm-Message-State: AHYfb5jtYyIQJnuGwZQ+nCAsCv3oKsAXv6qIExPrMUF2Dxfj97RaHSia crgrNGAPXwy8oKtTEjQ= X-Received: by 10.99.39.135 with SMTP id n129mr1319424pgn.36.1503418969204; Tue, 22 Aug 2017 09:22:49 -0700 (PDT) Received: from linux.local ([42.109.136.3]) by smtp.gmail.com with ESMTPSA id q185sm29131488pfb.119.2017.08.22.09.22.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Aug 2017 09:22:48 -0700 (PDT) From: PrasannaKumar Muralidharan To: herbert@gondor.apana.org.au, raltherr@google.com, linux-crypto@vger.kernel.org Cc: PrasannaKumar Muralidharan Subject: [PATCH] hw_random: timeriomem-rng: Remove 'max < 4' condition check Date: Tue, 22 Aug 2017 21:52:24 +0530 Message-Id: <20170822162224.26801-1-prasannatsmkumar@gmail.com> X-Mailer: git-send-email 2.10.0 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 read routiene max is always >= 4. The check whether 'max < 4' is not necessary. Remove it. Signed-off-by: PrasannaKumar Muralidharan Acked-By: Rick Altherr --- drivers/char/hw_random/timeriomem-rng.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c index 03ff548..f615684 100644 --- a/drivers/char/hw_random/timeriomem-rng.c +++ b/drivers/char/hw_random/timeriomem-rng.c @@ -53,13 +53,6 @@ static int timeriomem_rng_read(struct hwrng *hwrng, void *data, int period_us = ktime_to_us(priv->period); /* - * The RNG provides 32-bits per read. Ensure there is enough space for - * at minimum one read. - */ - if (max < sizeof(u32)) - return 0; - - /* * There may not have been enough time for new data to be generated * since the last request. If the caller doesn't want to wait, let them * bail out. Otherwise, wait for the completion. If the new data has