linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mm/hugetlb_cgroup: fix a -Wunused-but-set-variable
@ 2020-02-17 15:30 Qian Cai
  2020-02-18 18:58 ` Mina Almasry
  0 siblings, 1 reply; 3+ messages in thread
From: Qian Cai @ 2020-02-17 15:30 UTC (permalink / raw)
  To: akpm; +Cc: almasrymina, linux-mm, linux-kernel, Qian Cai

The commit c32300516047 ("hugetlb_cgroup: add interface for
charge/uncharge hugetlb reservations") forgot to remove an unused
variable,

mm/hugetlb_cgroup.c: In function 'hugetlb_cgroup_migrate':
mm/hugetlb_cgroup.c:777:25: warning: variable 'h_cg' set but not used
[-Wunused-but-set-variable]
  struct hugetlb_cgroup *h_cg;
                         ^~~~

Signed-off-by: Qian Cai <cai@lca.pw>
---
 mm/hugetlb_cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index ad777fecad28..8a86a2b62bef 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -774,7 +774,6 @@ void __init hugetlb_cgroup_file_init(void)
  */
 void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
 {
-	struct hugetlb_cgroup *h_cg;
 	struct hugetlb_cgroup *h_cg_rsvd;
 	struct hstate *h = page_hstate(oldhpage);
 
@@ -783,7 +782,6 @@ void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
 
 	VM_BUG_ON_PAGE(!PageHuge(oldhpage), oldhpage);
 	spin_lock(&hugetlb_lock);
-	h_cg = hugetlb_cgroup_from_page(oldhpage);
 	h_cg_rsvd = hugetlb_cgroup_from_page_rsvd(oldhpage);
 	set_hugetlb_cgroup(oldhpage, NULL);
 
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-18 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 15:30 [PATCH -next] mm/hugetlb_cgroup: fix a -Wunused-but-set-variable Qian Cai
2020-02-18 18:58 ` Mina Almasry
2020-02-18 19:16   ` Qian Cai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox