diff mbox series

bpf: remove unneeded break

Message ID 20201019173846.1021-1-trix@redhat.com
State New
Headers show
Series bpf: remove unneeded break | expand

Commit Message

Tom Rix Oct. 19, 2020, 5:38 p.m. UTC
From: Tom Rix <trix@redhat.com>

A break is not needed if it is preceded by a return

Signed-off-by: Tom Rix <trix@redhat.com>
---
 kernel/bpf/syscall.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Andrii Nakryiko Oct. 19, 2020, 6:28 p.m. UTC | #1
On Mon, Oct 19, 2020 at 10:38 AM <trix@redhat.com> wrote:
>

> From: Tom Rix <trix@redhat.com>

>

> A break is not needed if it is preceded by a return

>

> Signed-off-by: Tom Rix <trix@redhat.com>

> ---


Probably refactoring left over, looks good:

Acked-by: Andrii Nakryiko <andrii@kernel.org>


>  kernel/bpf/syscall.c | 1 -

>  1 file changed, 1 deletion(-)

>

> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c

> index 1110ecd7d1f3..8f50c9c19f1b 100644

> --- a/kernel/bpf/syscall.c

> +++ b/kernel/bpf/syscall.c

> @@ -2913,7 +2913,6 @@ attach_type_to_prog_type(enum bpf_attach_type attach_type)

>         case BPF_CGROUP_INET_INGRESS:

>         case BPF_CGROUP_INET_EGRESS:

>                 return BPF_PROG_TYPE_CGROUP_SKB;

> -               break;

>         case BPF_CGROUP_INET_SOCK_CREATE:

>         case BPF_CGROUP_INET_SOCK_RELEASE:

>         case BPF_CGROUP_INET4_POST_BIND:

> --

> 2.18.1

>
diff mbox series

Patch

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 1110ecd7d1f3..8f50c9c19f1b 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2913,7 +2913,6 @@  attach_type_to_prog_type(enum bpf_attach_type attach_type)
 	case BPF_CGROUP_INET_INGRESS:
 	case BPF_CGROUP_INET_EGRESS:
 		return BPF_PROG_TYPE_CGROUP_SKB;
-		break;
 	case BPF_CGROUP_INET_SOCK_CREATE:
 	case BPF_CGROUP_INET_SOCK_RELEASE:
 	case BPF_CGROUP_INET4_POST_BIND: