Skip to content

Commit

Permalink
netatop: fix compilation warning for kernel module
Browse files Browse the repository at this point in the history
Fix compilation warning for missing fallthrough.
Fix compilation warning:
/builder/shared-workdir/build/build_dir/target-mipsel_24kc_musl/netatop-3.1/module/netatop.c: In function 'getsockopt':
/builder/shared-workdir/build/build_dir/target-mipsel_24kc_musl/netatop-3.1/module/netatop.c:1619:26: error: this statement may fall through [-Werror=implicit-fallthrough=]
 1619 |                 tasktype = 'g';
      |                 ~~~~~~~~~^~~~~
/builder/shared-workdir/build/build_dir/target-mipsel_24kc_musl/netatop-3.1/module/netatop.c:1621:12: note: here
 1621 |            case NETATOP_GETCNT_PID:
      |            ^~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <[email protected]>
  • Loading branch information
Ansuel committed May 14, 2023
1 parent f95cd0b commit d3e10fd
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/module/netatop.c
+++ b/module/netatop.c
@@ -1617,7 +1617,7 @@ getsockopt(struct sock *sk, int cmd, void __user *user, int *len)

case NETATOP_GETCNT_TGID:
tasktype = 'g';
- // fall through
+ fallthrough;
case NETATOP_GETCNT_PID:
if (*len < sizeof(pid_t))
return -EINVAL;

0 comments on commit d3e10fd

Please sign in to comment.