Skip to contentSkip to conversation

net: make symbol 'flush_works' static

PATCH Applied Wei Yongjun 2 participants 2 messages Jul 13, 2020 – Jul 14, 2020

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

PATCH v2 1/1 net: make symbol 'flush_works' static

The sparse tool complains as follows:

net/core/dev.c:5594:1: warning:
symbol '__pcpu_scope_flush_works' was not declared. Should it be static?

'flush_works' is not used outside of dev.c, so marks it static.

Fixes 41852497a9205 ("net: batch calls to flush_all_backlogs()")

---
v1 - > v2: add fixes tag

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index eab4ebe3c21c..b61075828358 100644
@@ -5591,7 +5591,7 @@ void netif_receive_skb_list(struct list_head *head)
 }
 EXPORT_SYMBOL(netif_receive_skb_list);
 
-DEFINE_PER_CPU(struct work_struct, flush_works);
+static DEFINE_PER_CPU(struct work_struct, flush_works);
 
 /* Network device is going away, flush any packets still pending */
 static void flush_backlog(struct work_struct *work)
maintainer Applied
#1 lore raw

From: Wei Yongjun <[email protected]>
Date: Mon, 13 Jul 2020 22:23:44 +0800

Quoted 11 lines

The sparse tool complains as follows:

net/core/dev.c:5594:1: warning:
symbol '__pcpu_scope_flush_works' was not declared. Should it be static?

'flush_works' is not used outside of dev.c, so marks it static.

Fixes 41852497a9205 ("net: batch calls to flush_all_backlogs()")

Applied.