netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][bpf-next] bpf: remove redundant variable old_flags
@ 2017-10-11 10:56 Colin King
  2017-10-11 18:15 ` Alexei Starovoitov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2017-10-11 10:56 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, netdev; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable old_flags is being assigned but is never read; it is redundant
and can be removed.

Cleans up clang warning: Value stored to 'old_flags' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 kernel/bpf/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index e88abc0865d5..3db5a17fcfe8 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -192,7 +192,6 @@ int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
 	struct cgroup_subsys_state *css;
 	struct bpf_prog_list *pl;
 	bool pl_was_allocated;
-	u32 old_flags;
 	int err;
 
 	if ((flags & BPF_F_ALLOW_OVERRIDE) && (flags & BPF_F_ALLOW_MULTI))
@@ -239,7 +238,6 @@ int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
 		pl->prog = prog;
 	}
 
-	old_flags = cgrp->bpf.flags[type];
 	cgrp->bpf.flags[type] = flags;
 
 	/* allocate and recompute effective prog arrays */
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][bpf-next] bpf: remove redundant variable old_flags
  2017-10-11 10:56 [PATCH][bpf-next] bpf: remove redundant variable old_flags Colin King
@ 2017-10-11 18:15 ` Alexei Starovoitov
  2017-10-11 22:19 ` Daniel Borkmann
  2017-10-12  3:23 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2017-10-11 18:15 UTC (permalink / raw)
  To: Colin King
  Cc: Alexei Starovoitov, Daniel Borkmann, netdev, kernel-janitors,
	linux-kernel

On Wed, Oct 11, 2017 at 11:56:23AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable old_flags is being assigned but is never read; it is redundant
> and can be removed.
> 
> Cleans up clang warning: Value stored to 'old_flags' is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  kernel/bpf/cgroup.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
> index e88abc0865d5..3db5a17fcfe8 100644
> --- a/kernel/bpf/cgroup.c
> +++ b/kernel/bpf/cgroup.c
> @@ -192,7 +192,6 @@ int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
>  	struct cgroup_subsys_state *css;
>  	struct bpf_prog_list *pl;
>  	bool pl_was_allocated;
> -	u32 old_flags;
>  	int err;
>  
>  	if ((flags & BPF_F_ALLOW_OVERRIDE) && (flags & BPF_F_ALLOW_MULTI))
> @@ -239,7 +238,6 @@ int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
>  		pl->prog = prog;
>  	}
>  
> -	old_flags = cgrp->bpf.flags[type];

Acked-by: Alexei Starovoitov <ast@kernel.org>

thanks for the cleanup. That was a leftover of one of the previous
experiments I did.

The patch is for net-next.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][bpf-next] bpf: remove redundant variable old_flags
  2017-10-11 10:56 [PATCH][bpf-next] bpf: remove redundant variable old_flags Colin King
  2017-10-11 18:15 ` Alexei Starovoitov
@ 2017-10-11 22:19 ` Daniel Borkmann
  2017-10-12  3:23 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2017-10-11 22:19 UTC (permalink / raw)
  To: Colin King, Alexei Starovoitov, netdev; +Cc: kernel-janitors, linux-kernel

On 10/11/2017 12:56 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable old_flags is being assigned but is never read; it is redundant
> and can be removed.
>
> Cleans up clang warning: Value stored to 'old_flags' is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][bpf-next] bpf: remove redundant variable old_flags
  2017-10-11 10:56 [PATCH][bpf-next] bpf: remove redundant variable old_flags Colin King
  2017-10-11 18:15 ` Alexei Starovoitov
  2017-10-11 22:19 ` Daniel Borkmann
@ 2017-10-12  3:23 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-10-12  3:23 UTC (permalink / raw)
  To: colin.king; +Cc: ast, daniel, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Wed, 11 Oct 2017 11:56:23 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable old_flags is being assigned but is never read; it is redundant
> and can be removed.
> 
> Cleans up clang warning: Value stored to 'old_flags' is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-12  3:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-11 10:56 [PATCH][bpf-next] bpf: remove redundant variable old_flags Colin King
2017-10-11 18:15 ` Alexei Starovoitov
2017-10-11 22:19 ` Daniel Borkmann
2017-10-12  3:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).