From patchwork Mon Jan 25 15:45:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101119 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1435774lbb; Mon, 25 Jan 2016 07:49:50 -0800 (PST) X-Received: by 10.66.218.225 with SMTP id pj1mr26232485pac.40.1453736990524; Mon, 25 Jan 2016 07:49:50 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id e70si34446159pfb.131.2016.01.25.07.49.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2016 07:49:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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 1aNjNi-0005RU-0p; Mon, 25 Jan 2016 15:48:42 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNjML-000467-M4 for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2016 15:47:19 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0MDTqb-1aKljv42t3-00Gtne; Mon, 25 Jan 2016 16:46:47 +0100 From: Arnd Bergmann To: Johannes Weiner , Michal Hocko , Vladimir Davydov Subject: [PATCH] mm/memcontrol: avoid a spurious gcc warning Date: Mon, 25 Jan 2016 16:45:50 +0100 Message-Id: <1453736756-1959377-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:GTS85t4iP6p/bumoMGc9FLQYrHrRpu2Hf8TbowpNnJpjgIxaq7W YvqcE9dVgAVDhcRxgmINPXgl0l//MAPz14PyjkbxhKto9Mlus9pbmyDabZN9Fr9oOZ62B1M M+5rH2byVD7SsesqCY0Oi+oiYjLF/xnsE3wDOdwtNVyGmwELwI71PlczxkwmQ/mLJf0Fpqm cNJP7okKt58j7k7Lz7gig== X-UI-Out-Filterresults: notjunk:1; V01:K0:cl+z2hTPIkg=:EO9II490tvReC1qhro3aEI +Jbi5lWEtcGOshpNW13vxIe2In8eVfbeY0+cDlr8fMF6YmjIKJS7YO8Xh61N4ibPnJGVQ9kCw AQ+Oj9DTO2zglG8FOfGNlRk4xDXTo27f1ythjIUYpymCU7v73P+8KT2fYr/R77SBaYlwmqtQ9 0mvL5HpqKDvfPpR4Xc4iFD95U57nL3B4ie7LbFWJ7X7v6MDF5RxKtAhiZY3Nx9nZlqrZc6XdG PyZKAyGNdiIuo4zE0tcxHrv6S/g6pDsuQX6StLwwmzy1IRTgP1T0/45KEUOtblfB5yrdqv4Vy jBCtoPnoAN/ZwT1un0mYJLBaEn/Cm4YaMxHsVOVHcOjcnu0NCt8zcNnF9lHx8/u/j9T/bSm3q FZyR2Vlc0XOUIyzYV4wSLq9JW95D1x+X8HvoGYD5CEOYoCgzpv/USXoRoeiEiYkS1SrBFf8iD qUhVDG1tOlTOY/kYZnQ2GeyjPuy10ZziGhKbxLXLaubp8U8NXZRHcZw+fw8QoR0CyO1a/578x EeNEUL40Sa2xYuoVAgPh2sP0vX0f7O+3WspX31b9JlMBmHglxpiB75Ts8Otruzi468eBEj+QS 7kGed76xPoDTrfZMku2nvDTQKcqvt31RyAxm91OzveDDV8QzNaBYw/Ej9oW4/9esRIu2XfCZp Jq4ybP+0P7iv5vK9S5hcNJuGsL7IPo2Xg0k0ATwKKWL+ueTSyO0n2D9dmZDA1mi2eSqU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160125_074718_365680_FE8B0F76 X-CRM114-Status: GOOD ( 12.77 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.134 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.134 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org When CONFIG_DEBUG_VM is set, the various VM_BUG_ON() confuse gcc to the point where it cannot remember that 'memcg' is known to be initialized: mm/memcontrol.c: In function 'mem_cgroup_can_attach': mm/memcontrol.c:4791:9: warning: 'memcg' may be used uninitialized in this function [-Wmaybe-uninitialized] On ARM gcc-5.1, the above happens when any two or more of the VM_BUG_ON() are active, but not when I remove most or all of them. This is clearly random behavior and the only way I've found to shut up the warning is to add an explicit initialization. Signed-off-by: Arnd Bergmann --- mm/memcontrol.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d06cae2de783..9340eb981653 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4762,6 +4762,7 @@ static int mem_cgroup_can_attach(struct cgroup_taskset *tset) * multiple. */ p = NULL; + memcg = NULL; cgroup_taskset_for_each_leader(leader, css, tset) { WARN_ON_ONCE(p); p = leader;