Skip to contentSkip to conversation

bpf: remove unneeded break

PATCH In review [email protected] 2 participants 2 messages Oct 19, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: remove unneeded break

From: Tom Rix <[email protected]>

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

---
 kernel/bpf/syscall.c | 1 -
 1 file changed, 1 deletion(-)
kernel/bpf/syscall.c +0 -1
index 1110ecd7d1f3..8f50c9c19f1b 100644
@@ -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:
Signature · 1 line
2.18.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Mon, Oct 19, 2020 at 10:38 AM <[email protected]> wrote:

From: Tom Rix <[email protected]>

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

---

Probably refactoring left over, looks good:

Quoted 18 lines
 kernel/bpf/syscall.c | 1 -
 1 file changed, 1 deletion(-)
kernel/bpf/syscall.c +0 -2
index 1110ecd7d1f3..8f50c9c19f1b 100644
@@ -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