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: 117761 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1922186qgn; Thu, 2 Nov 2017 02:22:49 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TL+9AKfNj57TOLzcrfxqaWCqu5FX8f1ufZc9P+kfBfbPY6DJLmBXsXKNGn8ayfnTMVdcfv X-Received: by 10.98.210.5 with SMTP id c5mr3036481pfg.181.1509614569819; Thu, 02 Nov 2017 02:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509614569; cv=none; d=google.com; s=arc-20160816; b=TMrVryYKeVZnQkGyE8bL+O0qNpd32jnocNJijvqW9y5HKqOrk7oihStcqsI5XOYeGP os+oL4dtZKfgdbPKrAmA975ScFIgtHwskRFxopnIqsAoiVMwis3l1H1YyDkLoKJ17BDk qtAR273bdytnWqgxvU6C0Pc68L/YR2lcTGLiKbDZ9idFdJPpdjbFtYgF+5du/rN7AnpE wVWZLjs58eDoECij7yo++DnZGlBnWXLCylc81Usdv6t7bnrYQ0nmV69DKI0BD1GFMOQI 3Cmy+K+Ybx1IzaIycfLd2FpsOiZa0jblc+DmoY6OnRPkSHczngb/JKLLqFt6XY+RE+dm bCxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ajud97HpWlr1r1yc+36U93Tx0MuwwSP5r7XgRgmYgwc=; b=Ei7rFYVRSzZcknawYcZmhjiEe5mJzVOs+ZRcT/nBetVIigSZ7tM9JWlfXDZgFdsLvd j2ksbLk+Hp552KKPtym8RNTINt6KXty8jzl3aii/PNN9VBs7pA9FwlsTHAtWqFno4xTQ ugfFnzyMBKsRj89m21ActksS5Z7I/PQU0lLa10vQO4cl9xaEdnIvGP9fMG8+Qk78VD29 IN1zwkaW81KyowqEpv4Ios5ZDPydzwbA5EXhtP0URNp5Mm3JRdkpmgykDgBZPpVEcJiS /xeWi8SVdl4/uVJXCEfLE4uSFxO16LVgKq1VVmdyJdJWCW4Wm4Qlxaaa5cLeiJjN8kzg J4tw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si3201958pfg.299.2017.11.02.02.22.49; Thu, 02 Nov 2017 02:22:49 -0700 (PDT) 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 S933259AbdKBJWr (ORCPT + 26 others); Thu, 2 Nov 2017 05:22:47 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:54874 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752865AbdKBJWp (ORCPT ); Thu, 2 Nov 2017 05:22:45 -0400 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 Cc: Arnd Bergmann , Nicolas Pitre , afzal mohammed , Laura Abbott , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: NOMMU: work around maybe-uninitialized warning Date: Thu, 2 Nov 2017 10:21:21 +0100 Message-Id: <20171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+Qi7/ug5e QoxqLpdcRL+OmFCnKICzjQtgucOErPKiL7nWiw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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;