Skip to contentSkip to conversation

mm/vmscan.c:Fix -Wunused-but-set-variable warning

PATCH Applied Kai Song 2 participants 2 messages Sep 26, 2021 – Sep 27, 2021

Subsystems (3)
lore
Share & tools
lore

Kai Song

author
#0 lore raw

PATCH 1/1 mm/vmscan.c:Fix -Wunused-but-set-variable warning

We fix the following warning when building kernel with W=1:
mm/vmscan.c:1362:6: warning: variable 'err' set but not used [-Wunused-but-set-variable]

---
 mm/vmscan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/vmscan.c +1 -2
index f8b43f131673..7cf702bc1959 100644
@@ -1359,7 +1359,6 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
 {
 	int target_nid = next_demotion_node(pgdat->node_id);
 	unsigned int nr_succeeded;
-	int err;
 
 	if (list_empty(demote_pages))
 		return 0;
@@ -1368,7 +1367,7 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
 		return 0;
 
 	/* Demotion ignores all cpuset and mempolicy settings */
-	err = migrate_pages(demote_pages, alloc_demote_page, NULL,
+	migrate_pages(demote_pages, alloc_demote_page, NULL,
 			    target_nid, MIGRATE_ASYNC, MR_DEMOTION,
 			    &nr_succeeded);
 
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Kai Song

We fix the following warning when building kernel with W=1:
mm/vmscan.c:1362:6: warning: variable 'err' set but not used [-Wunused-but-set-variable]

Quoted 29 lines
---
 mm/vmscan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/vmscan.c +1 -3
index f8b43f131673..7cf702bc1959 100644
@@ -1359,7 +1359,6 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
 {
        int target_nid = next_demotion_node(pgdat->node_id);
        unsigned int nr_succeeded;
-       int err;
 
        if (list_empty(demote_pages))
                return 0;
@@ -1368,7 +1367,7 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
                return 0;
 
        /* Demotion ignores all cpuset and mempolicy settings */
-       err = migrate_pages(demote_pages, alloc_demote_page, NULL,
+       migrate_pages(demote_pages, alloc_demote_page, NULL,
                            target_nid, MIGRATE_ASYNC, MR_DEMOTION,
                            &nr_succeeded);
 
--

2.27.0