* [PATCH v2 bpf] samples/bpf: drop unnecessary fallthrough
@ 2023-05-16 0:17 Andrii Nakryiko
2023-05-16 3:17 ` Yonghong Song
0 siblings, 1 reply; 2+ messages in thread
From: Andrii Nakryiko @ 2023-05-16 0:17 UTC (permalink / raw)
To: bpf, ast, daniel, martin.lau; +Cc: andrii, kernel-team
__fallthrough is now not supported. Instead of renaming it to
now-canonical ([0]) fallthrough pseudo-keyword, just get rid of it and
equate 'h' case to default case, as both emit usage information and
succeed.
[0] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
samples/bpf/hbm.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c
index 6448b7826107..bf66277115e2 100644
--- a/samples/bpf/hbm.c
+++ b/samples/bpf/hbm.c
@@ -498,7 +498,6 @@ int main(int argc, char **argv)
"Option -%c requires an argument.\n\n",
optopt);
case 'h':
- __fallthrough;
default:
Usage();
return 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 bpf] samples/bpf: drop unnecessary fallthrough
2023-05-16 0:17 [PATCH v2 bpf] samples/bpf: drop unnecessary fallthrough Andrii Nakryiko
@ 2023-05-16 3:17 ` Yonghong Song
0 siblings, 0 replies; 2+ messages in thread
From: Yonghong Song @ 2023-05-16 3:17 UTC (permalink / raw)
To: Andrii Nakryiko, bpf, ast, daniel, martin.lau; +Cc: kernel-team
On 5/15/23 5:17 PM, Andrii Nakryiko wrote:
> __fallthrough is now not supported. Instead of renaming it to
> now-canonical ([0]) fallthrough pseudo-keyword, just get rid of it and
> equate 'h' case to default case, as both emit usage information and
> succeed.
>
> [0] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-16 3:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16 0:17 [PATCH v2 bpf] samples/bpf: drop unnecessary fallthrough Andrii Nakryiko
2023-05-16 3:17 ` Yonghong Song
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).