Skip to contentSkip to conversation

bpf: make function xdp_do_generic_redirect_map() static

PATCH Applied Xiongwei Song 2 participants 2 messages Dec 18, 2017 – Dec 19, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: make function xdp_do_generic_redirect_map() static

The function xdp_do_generic_redirect_map() is only used in this file, so make it static.

Clean up sparse warning:
net/core/filter.c:2687:5: warning: no previous prototype for 'xdp_do_generic_redirect_map' [-Wmissing-prototypes]

---
 net/core/filter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/core/filter.c +3 -2
index 754abe1041b7..130b842c3a15 100644
@@ -2684,8 +2684,9 @@ static int __xdp_generic_ok_fwd_dev(struct sk_buff *skb, struct net_device *fwd)
 	return 0;
 }
 
-int xdp_do_generic_redirect_map(struct net_device *dev, struct sk_buff *skb,
-				struct bpf_prog *xdp_prog)
+static int xdp_do_generic_redirect_map(struct net_device *dev,
+				       struct sk_buff *skb,
+				       struct bpf_prog *xdp_prog)
 {
 	struct redirect_info *ri = this_cpu_ptr(&redirect_info);
 	unsigned long map_owner = ri->map_owner;
Signature · 1 line
2.15.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Xiongwei Song

The function xdp_do_generic_redirect_map() is only used in this file, so make it static.

Clean up sparse warning:
net/core/filter.c:2687:5: warning: no previous prototype for 'xdp_do_generic_redirect_map' [-Wmissing-prototypes]

Applied to bpf-next, thanks Xiongwei!