• Alexander Alemayhu's avatar
    bpf: reduce compiler warnings by adding fallthrough comments · 7e57fbb2
    Alexander Alemayhu authored
    Fixes the following warnings:
    
    kernel/bpf/verifier.c: In function ‘may_access_direct_pkt_data’:
    kernel/bpf/verifier.c:702:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
       if (t == BPF_WRITE)
          ^
    kernel/bpf/verifier.c:704:2: note: here
      case BPF_PROG_TYPE_SCHED_CLS:
      ^~~~
    kernel/bpf/verifier.c: In function ‘reg_set_min_max_inv’:
    kernel/bpf/verifier.c:2057:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
       true_reg->min_value = 0;
       ~~~~~~~~~~~~~~~~~~~~^~~
    kernel/bpf/verifier.c:2058:2: note: here
      case BPF_JSGT:
      ^~~~
    kernel/bpf/verifier.c:2068:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
       true_reg->min_value = 0;
       ~~~~~~~~~~~~~~~~~~~~^~~
    kernel/bpf/verifier.c:2069:2: note: here
      case BPF_JSGE:
      ^~~~
    kernel/bpf/verifier.c: In function ‘reg_set_min_max’:
    kernel/bpf/verifier.c:2009:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
       false_reg->min_value = 0;
       ~~~~~~~~~~~~~~~~~~~~~^~~
    kernel/bpf/verifier.c:2010:2: note: here
      case BPF_JSGT:
      ^~~~
    kernel/bpf/verifier.c:2019:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
       false_reg->min_value = 0;
       ~~~~~~~~~~~~~~~~~~~~~^~~
    kernel/bpf/verifier.c:2020:2: note: here
      case BPF_JSGE:
      ^~~~
    Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
    Signed-off-by: default avatarAlexander Alemayhu <alexander@alemayhu.com>
    Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7e57fbb2
verifier.c 96.4 KB