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
22712271 return 0;
22722272 }
22732273
2274+#ifdef CONFIG_PROC_FS
22742275 #define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type)
22752276 #define BPF_MAP_TYPE(_id, _ops)
22762277 #define BPF_LINK_TYPE(_id, _name) [_id] = #_name,
@@ -2282,7 +2283,6 @@ static const char *bpf_link_type_strs[] = { · 5 unmodified lines
22822283 #undef BPF_MAP_TYPE
22832284 #undef BPF_LINK_TYPE
22842285
2285−#ifdef CONFIG_PROC_FS
22862286 static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
22872287 {
22882288 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