Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/huge_memory.c: fix "orig_pud" set but not used

Commit a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent
hugepages") introduced pudp_huge_get_and_clear_full() but no one uses
its return code.

In order to not diverge from pmdp_huge_get_and_clear_full(), just change
zap_huge_pud() to not assign the return value from
pudp_huge_get_and_clear_full().

mm/huge_memory.c: In function 'zap_huge_pud':
mm/huge_memory.c:1982:8: warning: variable 'orig_pud' set but not used [-Wunused-but-set-variable]
pud_t orig_pud;
^~~~~~~~

Link: http://lkml.kernel.org/r/20190301221956.97493-1-cai@lca.pw
Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Qian Cai and committed by
Linus Torvalds
70516b93 cd02cf1a

+1 -3
+1 -3
mm/huge_memory.c
··· 1982 1982 int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, 1983 1983 pud_t *pud, unsigned long addr) 1984 1984 { 1985 - pud_t orig_pud; 1986 1985 spinlock_t *ptl; 1987 1986 1988 1987 ptl = __pud_trans_huge_lock(pud, vma); ··· 1993 1994 * pgtable_trans_huge_withdraw after finishing pudp related 1994 1995 * operations. 1995 1996 */ 1996 - orig_pud = pudp_huge_get_and_clear_full(tlb->mm, addr, pud, 1997 - tlb->fullmm); 1997 + pudp_huge_get_and_clear_full(tlb->mm, addr, pud, tlb->fullmm); 1998 1998 tlb_remove_pud_tlb_entry(tlb, pud, addr); 1999 1999 if (vma_is_dax(vma)) { 2000 2000 spin_unlock(ptl);