From patchwork Thu Nov 2 09:21:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10038207 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 8E1C4603B5 for ; Thu, 2 Nov 2017 09:22:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8716E28ECE for ; Thu, 2 Nov 2017 09:22:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BFBA28ED7; Thu, 2 Nov 2017 09:22:53 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F93928ECE for ; Thu, 2 Nov 2017 09:22:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=3u36VdEqlfPj8yTt6w2nACyeqIvF74vSRYSzb8unefM=; b=tB9 /J3qpB0YSA2gDKCb7A1adbD9QeXq3zt62nzLrSmp2+oPv0m9xFMiI72QCchYsTAZNfldEjlrldtfM c5y4McW131OpFJzTlzdtZZC+R+5kB3eLw7Ie9b8L+RaTQUpVMSXdzJZJZJFIV78swDreoJqAnyIHm IJp+bst7rZF9lz1mjMzOzaT2bWUmXvGwY7PUEiVCZggNliVeF7iiWKkvSKKXk89mnS++/4ePErCtq somYT0dDXq5N6U+xP9gxvGYNPO6cBfkfjkvjjACiAqyH/fgwj214Beu12Fg6PceBtomBTqrgMbYEX uQf57/705GYoc1b+dXWEYH+Gi2EkyCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eABi2-0004cC-KT; Thu, 02 Nov 2017 09:22:46 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eABhk-0004NH-O4 for linux-arm-kernel@lists.infradead.org; Thu, 02 Nov 2017 09:22:44 +0000 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LeLdN-1dMp2W0P1R-00qF01; Thu, 02 Nov 2017 10:21:57 +0100 From: Arnd Bergmann To: Russell King , Vladimir Murzin Subject: [PATCH] ARM: NOMMU: work around maybe-uninitialized warning Date: Thu, 2 Nov 2017 10:21:21 +0100 Message-Id: <20171102092155.737712-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:vEHnGhx52Mm0p+89XAqgOvElWNANZWRAt2HPqhJyfWNyq4kDX43 wh7qfXvMhRnG0uWtlj/rOf1AN17iARevWKIFa0kKgHm6U1EriXdKC+rkzkbXiL1kFVlUOuF Lb6BUxkJVAXQbv7ZYNZ6Ho/e62mf5sMoLgvTMSuvcsp5OQ1TG4EdmX2xt9gHokht/Zb30nq PbNbEWpXMSAjZF2UpvNzw== X-UI-Out-Filterresults: notjunk:1; V01:K0:EiramRrOe1A=:lSIx/lGRONQQBeuiLZnpJk 4vLEX39zlQdtuEJy2FAIImdU9fN0KgOljbF0HsSuGnj/9f9gSI3tvk9UCEpWkD1yKRdrR9pW9 H4oxAc4A5aNL6EeFOyL6b2IF0lu5UAdhGie4IJSduVzO76amg8VKrBQ2KAJZOVRtMEHTC/lns DRvFYRMU/uwq/x61MGNbwlKF/SX5cCxd6otFm80SJRs0prGGZ08VI0Y7+DfsHtXBqIi/yTrzw 3W4vPccEWhlCvy7V0/G8NTTwkfCXvoKuhImpu+GXSi7W8e1yuCII8xuRMHKkCD1fl5JAQ1qEW Tu6jIaLOsUVQssh12Ql0Xen3h26ICeBkGa4NHRtC/AOOPXtcQxqDYSLize8vc5GD2sbY9ouZ0 f1C3hecdHTvfcDRjhOP6JQniKUxaJQY/4gU4SI6VF3rLcUW4p3RlEYLZrtOl6cJKxA5VO+DB6 v8j60WHDsunsUUTp9KTvMegwL3dAd4Ku0L4lMLoXVZll4hBSQi2vLf0vHbo4Cnkab1LcGp9IC T//MuiuJSFnsv/IwBeb+Y4+hZUoe9VrHGdGtLJ1VFrJXXg/rsXfNT9nnLghb4+3TV+PxhHs27 hfcz72ZEl7yKovvli0/RL3Yb7Ns/OjlT1BnCOpRLDqMSVSAZXAHvQkJgLbyJHP78P6uDLN6ia bSIsfJZdyjjJkptOTryNZkHbhiJUyMPFYaYFPCrWk0D/iVetzvYMd/bokjLHCLl4+Qi7/ug5e QoxqLpdcRL+OmFCnKICzjQtgucOErPKiL7nWiw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171102_022229_247234_5CE99373 X-CRM114-Status: GOOD ( 13.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Pitre , Arnd Bergmann , linux-kernel@vger.kernel.org, Laura Abbott , afzal mohammed , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The reworked MPU code produces a new warning in some configurations, presumably starting with the code move after the compiler now makes different inlining decisions: arch/arm/mm/pmsa-v7.c: In function 'adjust_lowmem_bounds_mpu': arch/arm/mm/pmsa-v7.c:310:5: error: 'specified_mem_size' may be used uninitialized in this function [-Werror=maybe-uninitialized] This appears to be harmless, as we know that there is always at least one memblock, and the only way this could get triggered is if the for_each_memblock() loop was never entered. I could not come up with a better workaround than initializing the specified_mem_size to zero, but at least that is the value that the variable would have in the hypothetical case of no memblocks. Fixes: 877ec119dbbf ("ARM: 8706/1: NOMMU: Move out MPU setup in separate module") Signed-off-by: Arnd Bergmann --- Vladimir, if this looks good to you, can you forward it to Russell's patch tracker, or otherwise suggest a different fix? --- arch/arm/mm/pmsa-v7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/pmsa-v7.c b/arch/arm/mm/pmsa-v7.c index 106ae1c435a3..976df60ac426 100644 --- a/arch/arm/mm/pmsa-v7.c +++ b/arch/arm/mm/pmsa-v7.c @@ -234,7 +234,7 @@ static int __init allocate_region(phys_addr_t base, phys_addr_t size, /* MPU initialisation functions */ void __init adjust_lowmem_bounds_mpu(void) { - phys_addr_t specified_mem_size, total_mem_size = 0; + phys_addr_t specified_mem_size = 0, total_mem_size = 0; struct memblock_region *reg; bool first = true; phys_addr_t mem_start;