Skip to content

Commit 24c4122

Browse files
Qian CaiKAGA-KOKO
authored andcommitted
x86/mm: Remove unused variable 'old_pte'
The commit 3a19109 ("x86/mm: Fix try_preserve_large_page() to handle large PAT bit") fixed try_preserve_large_page() by using the corresponding pud/pmd prot/pfn interfaces, but left a variable unused because it no longer used pte_pfn(). Later, the commit 8679de0 ("x86/mm/cpa: Split, rename and clean up try_preserve_large_page()") renamed try_preserve_large_page() to __should_split_large_page(), but the unused variable remains. arch/x86/mm/pageattr.c: In function '__should_split_large_page': arch/x86/mm/pageattr.c:741:17: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable] Fixes: 3a19109 ("x86/mm: Fix try_preserve_large_page() to handle large PAT bit") Signed-off-by: Qian Cai <cai@lca.pw> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: dave.hansen@linux.intel.com Cc: luto@kernel.org Cc: peterz@infradead.org Cc: toshi.kani@hpe.com Cc: bp@alien8.de Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20190301152924.94762-1-cai@lca.pw
1 parent 3609e31 commit 24c4122

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/mm/pageattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ static int __should_split_large_page(pte_t *kpte, unsigned long address,
738738
{
739739
unsigned long numpages, pmask, psize, lpaddr, pfn, old_pfn;
740740
pgprot_t old_prot, new_prot, req_prot, chk_prot;
741-
pte_t new_pte, old_pte, *tmp;
741+
pte_t new_pte, *tmp;
742742
enum pg_level level;
743743

744744
/*
@@ -781,7 +781,7 @@ static int __should_split_large_page(pte_t *kpte, unsigned long address,
781781
* Convert protection attributes to 4k-format, as cpa->mask* are set
782782
* up accordingly.
783783
*/
784-
old_pte = *kpte;
784+
785785
/* Clear PSE (aka _PAGE_PAT) and move PAT bit to correct position */
786786
req_prot = pgprot_large_2_4k(old_prot);
787787

0 commit comments

Comments
 (0)