From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932476AbcEKO0P (ORCPT ); Wed, 11 May 2016 10:26:15 -0400 Received: from h2.hallyn.com ([78.46.35.8]:57588 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbcEKO0N (ORCPT ); Wed, 11 May 2016 10:26:13 -0400 Date: Wed, 11 May 2016 09:26:11 -0500 From: "Serge E. Hallyn" To: Arnd Bergmann Cc: Tejun Heo , "Serge E . Hallyn" , Li Zefan , Johannes Weiner , Aditya Kali , Aleksa Sarai , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cgroup: remove an unused variable Message-ID: <20160511142611.GB18632@mail.hallyn.com> References: <1462971450-728759-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462971450-728759-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Arnd Bergmann (arnd@arndb.de): > The newly introduced cgroup_show_path has an extraneous variable > that gcc warns about: > > kernel/cgroup.c: In function 'cgroup_show_path': > kernel/cgroup.c:1634:15: error: unused variable 'ret' [-Werror=unused-variable] > int len = 0, ret = 0; > > This must have been left over from a previous version that was > changed before it got committed. I checked the function and > found that two other variables in the same function have an > extraneous initialization, presumably another artifact from > the same rework. > > This patch removes the useless warning and the extra initializations. > > Signed-off-by: Arnd Bergmann Thanks, Arnd. Acked-by: Serge Hallyn > --- > kernel/cgroup.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > index afea39eb7649..29ead73d2536 100644 > --- a/kernel/cgroup.c > +++ b/kernel/cgroup.c > @@ -1631,8 +1631,8 @@ static int rebind_subsystems(struct cgroup_root *dst_root, u16 ss_mask) > static int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node, > struct kernfs_root *kf_root) > { > - int len = 0, ret = 0; > - char *buf = NULL; > + int len; > + char *buf; > struct cgroup_root *kf_cgroot = cgroup_root_from_kf(kf_root); > struct cgroup *ns_cgroup; > > -- > 2.7.0