From patchwork Fri Jan 22 10:53:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101142 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp583474lbb; Fri, 22 Jan 2016 02:54:16 -0800 (PST) X-Received: by 10.98.87.196 with SMTP id i65mr3364647pfj.72.1453460056458; Fri, 22 Jan 2016 02:54:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ey12si2871089pac.203.2016.01.22.02.54.16; Fri, 22 Jan 2016 02:54:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbcAVKyH (ORCPT + 7 others); Fri, 22 Jan 2016 05:54:07 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:57303 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753056AbcAVKxe (ORCPT ); Fri, 22 Jan 2016 05:53:34 -0500 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0Lafge-1Zgw4R1bGy-00kOyv; Fri, 22 Jan 2016 11:53:07 +0100 From: Arnd Bergmann To: Andy Gross , David Brown Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom/spm: shut up uninitialized variable warning Date: Fri, 22 Jan 2016 11:53:06 +0100 Message-ID: <2156542.o6ovXGcSIl@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:1FiQcQyZwkJqBomk7ZsiMTbJkKW1qiIX0nWxqdoDBAOhiMF3ddK XSXYoGUcXqvsno2Bgu/Uht3dXLc0/g93MW419TRQVeiXpCWgeuvhlity2zUVMaZgWuVX01w KJyL71KgtjIxS/hPKHS4B2kZ+52+HAjKN1ZUYOhUG0PU3yTqU4aSF6MRTlso/JzwY6RGiX9 SWsTG3PvSEqaigddRTdFw== X-UI-Out-Filterresults: notjunk:1; V01:K0:DzluLlADMrs=:kWhENR/xmwwdyy56pCaKha 6XEDXbqF6dYFQ6Pwe42vP7+Nzhj8Le1lsuPRs3rQJaJunPsfB2zgdW9EjKRlYZnebguGuSqtF /sThdLAJkX7TBlu4w0AtvLCCcRaIx1sjPa1JJBfh4u6bY/uK+O+F5/noYnpiiV3V7NzcuJLIw v+LesO8r6XApJ5OamS7u3EKzHZDpW6A5Se+V5sqoRfYL6vJVti4u2wvNq10vJp3XTCt4256Ug JheavsMx87lUrzybNX7+7cPbKTFoZwGcBiaupnZOPDC7n6pSoCVReaYxVaAk7uHpd8JMDvOcn 8qfTAd25lHlUzHP3idD1nEbmDKjdXziOxzw9yqrexTSHKkbSM5jFd0P7jQ8n0eMH0Iu5nVtMy zw7PjQjnOSrIlVQOeW+4QbGZhxdweWV5ZtUTXpNVPXheEoQgYh/sjGY68xFWSdJf2Y/WaTeAa sUpM5ytyQN1xlgP2rz1SLn2nODVJG+u4zYprRpOEq72vMhXaj5I9HUfc9ubNfZyRhPcHX6q5D gAd3z360beiA2aD8XKgpHYGiHv/AiLAViWo4ShMDDEUKYxFV2v0LhOT8vpe/qCxgttMtW/r+w FwQJOkHI8/GYwk56e12uPcy0TgKbnDLD5U/qzaGUNzpvS2Nl4rjkc9XqccYJBGeHzI2bfPAyb N3uzblyQLel+QjoHH+SbcobB02nuA3SpdMEbyAb8eaF9Vhd9kIVQrqyBRM0bs5+D6LdN+8uhv 8RBdh3ue2zknLehj Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org gcc warns about the 'found' variable possibly being used uninitialized: drivers/soc/qcom/spm.c: In function 'spm_dev_probe': drivers/soc/qcom/spm.c:305:5: error: 'found' may be used uninitialized in this function [-Werror=maybe-uninitialized] However, the code is correct because we know that there is always at least one online CPU. This initializes the 'found' variable to zero before the loop so the compiler knows it does not have to warn about it. Signed-off-by: Arnd Bergmann --- I'd like to send this with the bug fixes for 4.4-rc1 to shut up one of the remaining warnings we get from kernelci. -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index 0ad66fa9bb1a..5548a31e1a39 100644 --- a/drivers/soc/qcom/spm.c +++ b/drivers/soc/qcom/spm.c @@ -288,7 +288,7 @@ static struct spm_driver_data *spm_get_drv(struct platform_device *pdev, struct spm_driver_data *drv = 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);