From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756656AbbCCPM4 (ORCPT ); Tue, 3 Mar 2015 10:12:56 -0500 Received: from bhuna.collabora.co.uk ([93.93.135.160]:34743 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753829AbbCCPMz (ORCPT ); Tue, 3 Mar 2015 10:12:55 -0500 Message-ID: <54F5CF71.7060405@collabora.co.uk> Date: Tue, 03 Mar 2015 16:12:49 +0100 From: Javier Martinez Canillas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Tejun Heo CC: Li Zefan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] cgroup: fix var may be used uninitialized warning References: <1425373187-7227-1-git-send-email-javier.martinez@collabora.co.uk> <20150303134642.GD3122@htj.duckdns.org> In-Reply-To: <20150303134642.GD3122@htj.duckdns.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Tejun, On 03/03/2015 02:46 PM, Tejun Heo wrote: > On Tue, Mar 03, 2015 at 09:59:47AM +0100, Javier Martinez Canillas wrote: >> When building cgroup, GCC warns that the root variable >> may be used uninitialized in the cgroup_mount function. >> >> kernel/cgroup.c: In function ‘cgroup_mount’: >> kernel/cgroup.c:1886:13: warning: ‘root’ may be used uninitialized in this function [-Wuninitialized] >> kernel/cgroup.c:1742:22: note: ‘root’ was declared here >> >> This can never happen because if the struct cgroup_root >> can't be allocated, ret is set to -ENOMEM and the error >> returned so the code using root is not reachable. But >> set root to NULL just to silence the compiler warning. > > Which compiler are you on? > Yeah, I noticed that I was using a pretty old 4.7.2 GCC on that machine and the warning indeed is not seen with 4.9.1. Sorry for the noise... > Thanks. > Best regard, Javier