[PATCH -next] userfaultfd: Remove set but not used variable 'vm_alloc_shared'

From: YueHaibing
Date: Tue Jun 01 2021 - 10:16:56 EST


mm/userfaultfd.c: In function ‘__mcopy_atomic_hugetlb’:
mm/userfaultfd.c:284:6: warning: variable ‘vm_alloc_shared’ set but not used [-Wunused-but-set-variable]
int vm_alloc_shared = dst_vma->vm_flags & VM_SHARED;
^~~~~~~~~~~~~~~

commit 1786d0012620 ("mm, hugetlb: fix racy resv_huge_pages underflow on UFFDIO_COPY")
left behind this.

Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
---
mm/userfaultfd.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 33fb405219e9..0e2132834bc7 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -281,7 +281,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
unsigned long len,
enum mcopy_atomic_mode mode)
{
- int vm_alloc_shared = dst_vma->vm_flags & VM_SHARED;
int vm_shared = dst_vma->vm_flags & VM_SHARED;
ssize_t err;
pte_t *dst_pte;
@@ -380,7 +379,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,

mutex_unlock(&hugetlb_fault_mutex_table[hash]);
i_mmap_unlock_read(mapping);
- vm_alloc_shared = vm_shared;

cond_resched();

--
2.17.1