Skip to contentSkip to conversation

mm/userfaultfd: fix a GCC compilation warning

PATCH New Qian Cai 1 participant 1 message Oct 8, 2019

Subsystems (2)
lore
Share & tools
lore

Qian Cai

author
#0 lore raw

PATCH 1/1 mm/userfaultfd: fix a GCC compilation warning

The linux-next commit "hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash-fix" seems accidentally add back an unused variable that was correctly removed in the commit "hugetlb: remove unused hstate in hugetlb_fault_mutex_hash()" [1].

mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
mm/userfaultfd.c:217:17: warning: variable 'h' set but not used [-Wunused-but-set-variable]

  struct hstate *h;
                 ^

[1] http://lkml.kernel.org/r/[email protected]

---
 mm/userfaultfd.c | 3 ---
 1 file changed, 3 deletions(-)
mm/userfaultfd.c +0 -3
index 4cb4ef3d9128..1b0d7abad1d4 100644
@@ -214,7 +214,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 	unsigned long src_addr, dst_addr;
 	long copied;
 	struct page *page;
-	struct hstate *h;
 	unsigned long vma_hpagesize;
 	pgoff_t idx;
 	u32 hash;
@@ -271,8 +270,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 			goto out_unlock;
 	}
 
-	h = hstate_vma(dst_vma);
-
 	while (src_addr < src_start + len) {
 		pte_t dst_pteval;
 
Signature · 1 line
1.8.3.1