From patchwork Thu Feb 11 09:38:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102814 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp86219lbl; Thu, 11 Feb 2016 01:38:58 -0800 (PST) X-Received: by 10.66.90.166 with SMTP id bx6mr66098053pab.75.1455183538591; Thu, 11 Feb 2016 01:38:58 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q80si11484859pfi.236.2016.02.11.01.38.58; Thu, 11 Feb 2016 01:38:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287AbcBKJiz (ORCPT + 30 others); Thu, 11 Feb 2016 04:38:55 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:60743 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbcBKJiw (ORCPT ); Thu, 11 Feb 2016 04:38:52 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0Lv5z0-1a43ME1zjG-010P3Q; Thu, 11 Feb 2016 10:38:20 +0100 From: Arnd Bergmann To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Georgi Djakov , Liam Girdwood , linux-kernel@vger.kernel.org Subject: [PATCH] regulator: qcom-saw: avoid uninitialized variable warning Date: Thu, 11 Feb 2016 10:38:08 +0100 Message-Id: <1455183497-299798-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:5GHiWdSFhZHsKSxSAsiiATVVSQvt+v6igfyO9eJ9aPL6lws/SGy NBs3aNzeK68Lh6ZmaLc5hXJmF7eyOH90WmFKDRcKQERO/axMHjcKVV2W2/FpwASL4V4YPFV GgMcDCZo+lOyKYuFOAden3RBPdmeE1B7GeH8gtip7wri3lfrWq18Vi/lrqEfPChZZfj811R cfRr2yMM0v+MKKmPiCDqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:7qLj4tTZ1RY=:F1eXTKa5YW45HU+M4fVPOZ Uuepb87j1nwhQTxCALjiiCAKQ0sIUYTz8+VHPTd3VqEBE11wkFn4hE8R2B+5FG9EKrJEemnLE VQOk8XqyTNC96JJQjLwvWCnCfANM/LNloLxI3ZCSA7zmDpthyhSsE3bzHhXIhlQ9Up6gjXfEn e3tYtBPaWI9yPkPVrR32YP5SrX7KUXt95YXFVfl7cm0redCL4AJTCi0nDabNCdaLzL3hOsMAh nS3Ahw5/bqIZ8Yk/4RIbFhNquEfET1kRHk5eMB70y8WQdDpaj+ao/B5fnHLid7MfZOJRIgu4q 8OYVmU9ztQzISFNqj+LtDXG3FaAPdoaQRsIjVDAVdUkWCSy8hJmAOTRz7DUy1z06yqieS+Cm2 QXKFe+90IfaFclZN6Js9IC2k6VOMzcTY1tkaHQ8RS7Jg9OmiTAN/x2Yiv0tU9sQZytbxpgoxd kREKaVHFWlueoQUuaDuv8gK2+QFHfjlqbwjBHzl0fRxovv6OojBncuuDU03WonxRHT61KLN/P UemtCKp3e9GD+F660fLk6knIsG9+vjCGREBxhp2mXm2/kjhyyLS2lkmgIq/MmhxYqXGlpg6RW DgkY5lu6o0/4ZmSnookRt/Q09KyAbKkJ8X/CZKDGLTdlaVz/84yR6j8MRLExqOG8WoYfdJ4zT Y6XrpM7QLCA8sZIT0zISajmu8r3D13ufwrVbfaqbftELSiLv7bXwitVPEifvzMmHejz8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc cannot know that a for_each_possible_cpu() loop always executes at least once, so it warns about the use of the "found" variable in qcom_saw_regulator_probe: drivers/regulator/qcom_saw-regulator.c: In function 'qcom_saw_regulator_probe': drivers/regulator/qcom_saw-regulator.c:154:5: error: 'found' is used uninitialized in this function [-Werror=uninitialized] This adds an explicit initialization to avoid the warning. Signed-off-by: Arnd Bergmann Fixes: 18bba3b50355 ("regulator: qcom-saw: Add support for SAW regulators") --- drivers/regulator/qcom_saw-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/regulator/qcom_saw-regulator.c b/drivers/regulator/qcom_saw-regulator.c index c800f16adaf0..30af1d380f9f 100644 --- a/drivers/regulator/qcom_saw-regulator.c +++ b/drivers/regulator/qcom_saw-regulator.c @@ -137,7 +137,7 @@ static struct saw_vreg *saw_get_drv(struct platform_device *pdev, struct saw_vreg *vreg = NULL; struct device_node *cpu_node, *saw_node; int cpu; - bool found; + bool found = 0; for_each_possible_cpu(cpu) { cpu_node = of_cpu_device_node_get(cpu);