* [PATCH] cgroup: remove an unused variable
@ 2016-05-11 12:57 Arnd Bergmann
2016-05-11 14:26 ` Serge E. Hallyn
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-05-11 12:57 UTC (permalink / raw)
To: Tejun Heo
Cc: Serge E . Hallyn, Arnd Bergmann, Li Zefan, Johannes Weiner,
Aditya Kali, Aleksa Sarai, cgroups, linux-kernel
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 <arnd@arndb.de>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] cgroup: remove an unused variable
2016-05-11 12:57 [PATCH] cgroup: remove an unused variable Arnd Bergmann
@ 2016-05-11 14:26 ` Serge E. Hallyn
0 siblings, 0 replies; 2+ messages in thread
From: Serge E. Hallyn @ 2016-05-11 14:26 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Tejun Heo, Serge E . Hallyn, Li Zefan, Johannes Weiner,
Aditya Kali, Aleksa Sarai, cgroups, linux-kernel
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 <arnd@arndb.de>
Thanks, Arnd.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-11 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11 12:57 [PATCH] cgroup: remove an unused variable Arnd Bergmann
2016-05-11 14:26 ` Serge E. Hallyn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®