Skip to content
  • Arnd Bergmann's avatar
    bpf: clean up unused-variable warning · a7dcdf6e
    Arnd Bergmann authored
    The only user of this variable is inside of an #ifdef, causing
    a warning without CONFIG_INET:
    
    net/core/filter.c: In function '____bpf_sock_ops_cb_flags_set':
    net/core/filter.c:3382:6: error: unused variable 'val' [-Werror=unused-variable]
      int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS;
    
    This replaces the #ifdef with a nicer IS_ENABLED() check that
    makes the code more readable and avoids the warning.
    
    Fixes: b13d8807
    
     ("bpf: Adds field bpf_sock_ops_cb_flags to tcp_sock")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    a7dcdf6e