Message ID | 1464007448-25395-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> 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 250F7607D3 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 23 May 2016 17:15:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1566E2823A for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 23 May 2016 17:15:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A41E28246; Mon, 23 May 2016 17:15:57 +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=-2.5 required=2.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B3312823A for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 23 May 2016 17:15:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b4tRF-0000xS-5k; Mon, 23 May 2016 17:14:45 +0000 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b4tRB-0000oo-So for linux-arm-kernel@lists.infradead.org; Mon, 23 May 2016 17:14:42 +0000 Received: by mail-pa0-x242.google.com with SMTP id f8so6697565pag.0 for <linux-arm-kernel@lists.infradead.org>; 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=SCGUrgwvtpkkaj6R8wfja+qsFHRmy+jgU3URng9LDw1/4HXPKqC/KXTUfQPOtgL86/ zdjhJfHfkFGx/Hckxf9yH7Q7a47vB1MeseVvsvv/3dFyQnf9crfcVapxgRBFcKw30lf0 LbiDuxTDORUDpF+3Nq6pCS+a27HrZer0QbxZx7vb8BZvY9GK4Vilm7alPDCAf2AkYgld GywnkdMAENMyOaL8fGZzDdnnbHFyqTlBdUPw7o/cpHUPiDGOea8ODgVpJKvFnLVwHJEk MmNctkBlrRSDOECtyZKqrfvRc+fmb6QXnCkF2a4O73zFTLBw4IYRBuUlRkpug73rhvcb 8pOg== X-Gm-Message-State: AOPr4FUuEsANXmLzIHQ6NuuETHxFtOwBZd8CMimZvQv3FhYS2zqg6wgs0bwQjigeD7BMuQ== 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 <sudipm.mukherjee@gmail.com> To: Matt Mackall <mpm@selenic.com>, Herbert Xu <herbert@gondor.apana.org.au>, Maxime Coquelin <mcoquelin.stm32@gmail.com> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160523_101441_978961_113CCC84 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
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);
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 <sudip.mukherjee@codethink.co.uk> --- 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(-)