Skip to contentSkip to conversation

mm: swap: make pointer swap_avail_heads static

PATCH In review Colin King 2 participants 2 messages Feb 6, 2018 – Feb 7, 2018

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 mm: swap: make pointer swap_avail_heads static

From: Colin Ian King <[email protected]>

The pointer swap_avail_heads is local to the source and does not need to be in global scope, so make it static.

Cleans up sparse warning:
mm/swapfile.c:88:19: warning: symbol 'swap_avail_heads' was not declared. Should it be static?

---
 mm/swapfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/swapfile.c +1 -1
index 006047b16814..0d00471af98b 100644
@@ -85,7 +85,7 @@ PLIST_HEAD(swap_active_head);
  * is held and the locking order requires swap_lock to be taken
  * before any swap_info_struct->lock.
  */
-struct plist_head *swap_avail_heads;
+static struct plist_head *swap_avail_heads;
 static DEFINE_SPINLOCK(swap_avail_lock);
 
 struct swap_info_struct *swap_info[MAX_SWAPFILES];
Signature · 1 line
2.15.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Colin King

From: Colin Ian King <[email protected]>

The pointer swap_avail_heads is local to the source and does not need to be in global scope, so make it static.

Cleans up sparse warning:
mm/swapfile.c:88:19: warning: symbol 'swap_avail_heads' was not declared. Should it be static?

Best Regards,
Huang, Ying

Quoted 17 lines
---
 mm/swapfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/swapfile.c +1 -1
index 006047b16814..0d00471af98b 100644
@@ -85,7 +85,7 @@ PLIST_HEAD(swap_active_head);
  * is held and the locking order requires swap_lock to be taken
  * before any swap_info_struct->lock.
  */
-struct plist_head *swap_avail_heads;
+static struct plist_head *swap_avail_heads;
 static DEFINE_SPINLOCK(swap_avail_lock);
 
 struct swap_info_struct *swap_info[MAX_SWAPFILES];