From patchwork Mon May 23 12:44:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 9132171 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 AC237607D3 for ; Mon, 23 May 2016 17:14:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A8F62823A for ; Mon, 23 May 2016 17:14:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D88528246; Mon, 23 May 2016 17:14:24 +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=-5.2 required=2.0 tests=BAYES_00, DATE_IN_PAST_03_06, 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 008EC2823A for ; Mon, 23 May 2016 17:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753053AbcEWROW (ORCPT ); Mon, 23 May 2016 13:14:22 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33852 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752789AbcEWROV (ORCPT ); Mon, 23 May 2016 13:14:21 -0400 Received: by mail-pa0-f66.google.com with SMTP id yl2so18553627pac.1; Mon, 23 May 2016 10:14:21 -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=pVl7fYxGECsF5jMwi3fFzyVzHW8Gzr1uOmbgQm1v88A=; b=WVlDm/moYGKWPiizuAC9MP48Vr505IyRgcAY8cxDxRVky0YWfiSePC6y5WjC6iECL9 G+iHxpL1Hm1wApxnhUs52tB7OQUOOIqcgP7WL+MCnHJL+03mxxl8+upXjh6KxUHGi0Qi RXm8oNFs8v/XG0Cn4AkVXz4ZRLE5/G/G4r6EIZbxqKnlY5CObleJUc4PhvbMPEv6824r XDaKD6si+BbxHIyXYAAH1CaYDsTsqAxNWQk6/BxZmBLY3CgX7f0NxWk2M8sXohNP77ZA poB0KlCFMjTIiqyVeKq+p8P9yxQqq/Vx/e4a1PhyUw7ZH4niKNZoatxjIFAhxHFIplpU 2wBA== 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=pVl7fYxGECsF5jMwi3fFzyVzHW8Gzr1uOmbgQm1v88A=; b=BywepiuuE0Oqy6b3oh6TZp3XcwpepkR87vH0QpuB5gw8uQIzdCfQn6EGNtlAO+fU8U aFuiEUoUWdFxUiOi2ctRo7I3m9oyS/tYhbaEcKXYgKeCQjq4xo5dTy4S4T11Vg6FUybo Z5Y7YCdJsdKQS6bGTNYmsgbf8UuUJT7pcDlfukTgQzu/ob8nltrXRnF6D4e5GGpIrFCL Xyaeb3C5rvDN+j7ryuphuqPjg/JqS0anWiL0+Uj0bJCm8JyFN17x/5TYUoTWiGE5u6qG VgvyFY8q2ZanXqFiw6Z8Okvr6DHYbqE7CXIIV+4KTk5jmBns8qKcIb2nJCyjvJkeRBD/ Hg0A== X-Gm-Message-State: AOPr4FW66Pn2Qf1272yQIlPKRNBUayanGo36P1eK3/tSgok64jK7NQUUJVyJHUZqQGm76w== X-Received: by 10.66.43.51 with SMTP id t19mr29000161pal.48.1464023660877; Mon, 23 May 2016 10:14:20 -0700 (PDT) Received: from localhost.localdomain ([103.24.124.194]) by smtp.gmail.com with ESMTPSA id f187sm48016219pfb.60.2016.05.23.10.14.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 May 2016 10:14:19 -0700 (PDT) From: Sudip Mukherjee To: Matt Mackall , Herbert Xu , Maxime Coquelin Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sudip Mukherjee Subject: [PATCH] hwrng: stm32 - fix build warning Date: Mon, 23 May 2016 18:14:08 +0530 Message-Id: <1464007448-25395-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 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 We have been getting build warning about: drivers/char/hw_random/stm32-rng.c: In function 'stm32_rng_read': drivers/char/hw_random/stm32-rng.c:82:19: warning: 'sr' may be used uninitialized in this function On checking the code it turns out that sr can never be used uninitialized as sr is getting initialized in the while loop and while loop will always execute as the minimum value of max can be 32. So just initialize sr to 0 while declaring it to silence the compiler. Signed-off-by: Sudip Mukherjee --- build log at: https://travis-ci.org/sudipm-mukherjee/parport/jobs/132180906 drivers/char/hw_random/stm32-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index 92a8106..0533370 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -52,7 +52,7 @@ static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) { struct stm32_rng_private *priv = container_of(rng, struct stm32_rng_private, rng); - u32 sr; + u32 sr = 0; int retval = 0; pm_runtime_get_sync((struct device *) priv->rng.priv);