bpf: annotate implicit fall through
Subsystems (4)
PATCH 1/2 bpf: annotate implicit fall through
There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1).
This commit remove the following warning:
kernel/bpf/cgroup.c:719:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- kernel/bpf/cgroup.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/cgroup.c +1 -0
@@ -718,6 +718,7 @@ cgroup_dev_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)case BPF_FUNC_trace_printk:if (capable (CAP_SYS_ADMIN ))return bpf_get_trace_printk_proto (); +/* fall through */ default :return NULL ; }
Signature · 1 line
2.19.2
PATCH 2/2 bpf: annotate implicit fall through
There is a plan to build the kernel with -Wimplicit-fallthrough and thise place in the code produced a warnings (W=1).
In this particular case change a ‘:’ with a ‘,’ so as to match the regular expression expected by GCC.
This commit remove the following warning:
net/core/filter.c:5310:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/filter.c +1 -1
@@ -5309,7 +5309,7 @@ bpf_base_func_proto(enum bpf_func_id func_id)case BPF_FUNC_trace_printk:if (capable (CAP_SYS_ADMIN ))return bpf_get_trace_printk_proto (); -/* else: fall through */ +/* else, fall through */ default :return NULL ; }
Signature · 1 line
2.19.2
Quoted 2 lines · Mathieu Malaterre
There is a plan to build the kernel with -Wimplicit-fallthrough and thise place in the code produced a warnings (W=1).
This?
Quoted 17 lines
In this particular case change a ‘:’ with a ‘,’ so as to match the regular expression expected by GCC.
This commit remove the following warning:
net/core/filter.c:5310:6: warning: this statement may fall through [-Wimplicit-fallthrough=]Signed-off-by Mathieu Malaterre <[email protected]>--- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/core/filter.c +0
-0
net/core/filter.c bpf_base_func_proto(enum bpf_func_id func_id) · line 5312
Quoted 5 lines
net/core/filter.c +1
-1@@ -5309,7 +5309,7 @@ bpf_base_func_proto(enum bpf_func_id func_id)case BPF_FUNC_trace_printk:if (capable (CAP_SYS_ADMIN ))return bpf_get_trace_printk_proto (); -/* else: fall through */ +/* else, fall through */
The other patches seem to just drop "else:"...
net/core/filter.c bpf_base_func_proto(enum bpf_func_id func_id) · line 5315
Quoted 4 lines
net/core/filter.c +0
-0default :return NULL ; }
MBR, Sergei
Daniel Borkmann
maintainerQuoted 15 lines · Sergei Shtylyov
Quoted 2 lines · Mathieu Malaterre
There is a plan to build the kernel with -Wimplicit-fallthrough and thise place in the code produced a warnings (W=1).
This?
Quoted 8 lines
In this particular case change a ‘:’ with a ‘,’ so as to match the regular expression expected by GCC.
This commit remove the following warning:
net/core/filter.c:5310:6: warning: this statement may fall through [-Wimplicit-fallthrough=]Signed-off-by Mathieu Malaterre <[email protected]>
Please respin and also make the two subject lines not exactly the same.
Thanks,
Daniel
Quoted 23 lines
Quoted 9 lines
---
net/core/filter.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)net/core/filter.c +0
-0@@ -5309,7 +5309,7 @@ bpf_base_func_proto(enum bpf_func_id func_id)Quoted 5 lines
case
BPF_FUNC_trace_printk:
if (capable(CAP_SYS_ADMIN)) returnbpf_get_trace_printk_proto(); - /* else: fall through */
+ /* else, fall through */The other patches seem to just drop "else:"...
Quoted 4 lines
default:
return NULL;
}MBR, Sergei
PATCH v2 2/2 bpf: Correctly annotate implicit fall through in bpf_base_func_proto
In reply to Mathieu MalaterreThere is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1).
To preserve as much of the existing comment only change a ‘:’ into a ‘,’. This is enough change, to match the regular expression expected by GCC.
This commit remove the following warning:
net/core/filter.c:5310:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
---
v2: reword the patch subject, remove a typo
net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/filter.c +1 -1
@@ -5309,7 +5309,7 @@ bpf_base_func_proto(enum bpf_func_id func_id)case BPF_FUNC_trace_printk:if (capable (CAP_SYS_ADMIN ))return bpf_get_trace_printk_proto (); -/* else: fall through */ +/* else, fall through */ default :return NULL ; }
Signature · 1 line
2.19.2
PATCH v2 1/2 bpf: Annotate implicit fall through in cgroup_dev_func_proto
In reply to Mathieu MalaterreThere is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1).
This commit remove the following warning:
kernel/bpf/cgroup.c:719:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- kernel/bpf/cgroup.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/cgroup.c +1 -0
@@ -718,6 +718,7 @@ cgroup_dev_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)case BPF_FUNC_trace_printk:if (capable (CAP_SYS_ADMIN ))return bpf_get_trace_printk_proto (); +/* fall through */ default :return NULL ; }
Signature · 1 line
2.19.2
PATCH v2 1/2 bpf: Annotate implicit fall through in cgroup_dev_func_proto
In reply to Mathieu MalaterreThere is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1).
This commit remove the following warning:
kernel/bpf/cgroup.c:719:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
---
v2: Reword the patch subject
kernel/bpf/cgroup.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/cgroup.c +1 -0
@@ -718,6 +718,7 @@ cgroup_dev_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)case BPF_FUNC_trace_printk:if (capable (CAP_SYS_ADMIN ))return bpf_get_trace_printk_proto (); +/* fall through */ default :return NULL ; }
Signature · 1 line
2.19.2
Daniel Borkmann
maintainerRe: [PATCH v2 1/2] bpf: Annotate implicit fall through in cgroup_dev_func_proto
Quoted 8 lines · Mathieu Malaterre
There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1).
This commit remove the following warning:
kernel/bpf/cgroup.c:719:6: warning: this statement may fall through [-Wimplicit-fallthrough=]Signed-off-by Mathieu Malaterre <[email protected]>
Both applied, thanks!