History

bpf: Fix unused variable warning

Hiding the only using of bpf_link_type_strs[] in an #ifdef causes an unused-variable warning: kernel/bpf/syscall.c:2280:20: error: 'bpf_link_type_strs' defined but not used [-Werror=unused-variable] 2280 | static const char *bpf_link_type_strs[] = { Move the definition into the same #ifdef.

Arnd Bergmann committed 6 years ago

Commit 449e14b1 parent 0b9ad561 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/bpf/syscall.c+1−1
@@ -2271,6 +2271,7 @@ static int bpf_link_release(struct inode *inode, struct file *filp) · 2270 unmodified lines
2271 return 0;2271 return 0;
2272}2272}
2273 2273
2274#ifdef CONFIG_PROC_FS
2274#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type)2275#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type)
2275#define BPF_MAP_TYPE(_id, _ops)2276#define BPF_MAP_TYPE(_id, _ops)
2276#define BPF_LINK_TYPE(_id, _name) [_id] = #_name,2277#define BPF_LINK_TYPE(_id, _name) [_id] = #_name,
@@ -2282,7 +2283,6 @@ static const char *bpf_link_type_strs[] = { · 5 unmodified lines
2282#undef BPF_MAP_TYPE2283#undef BPF_MAP_TYPE
2283#undef BPF_LINK_TYPE2284#undef BPF_LINK_TYPE
2284 2285
2285#ifdef CONFIG_PROC_FS
2286static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)2286static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
2287{2287{
2288 const struct bpf_link *link = filp->private_data;2288 const struct bpf_link *link = filp->private_data;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t