]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/vmscan.c: fix -Wunused-but-set-variable warning
authorKai Song <songkai01@inspur.com>
Fri, 5 Nov 2021 20:42:22 +0000 (13:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:40 +0000 (13:30 -0700)
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]

Link: https://lkml.kernel.org/r/20210924181218.21165-1-songkai01@inspur.com
Signed-off-by: Kai Song <songkai01@inspur.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c

index 74296c2d1fed28e06088eb89b8e912bc73bd5f71..9483dd6af5500e35497bcff4fb13d2b7a0bea8dd 100644 (file)
@@ -1337,7 +1337,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;
@@ -1346,7 +1345,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);