Skip to contentSkip to conversation

fix warning in arch/x86/mm/pgtable.c

PATCH In review Michael Borisov 2 participants 2 messages Jul 26, 2008 – Jul 28, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix warning in arch/x86/mm/pgtable.c

This patch fixes the following compile warning:

arch/x86/mm/pgtable.c: In function ‘pgd_mop_up_pmds’:
arch/x86/mm/pgtable.c:194: warning: unused variable ‘pmd’

---

arch/x86/mm/pgtable.c +0 -1
index 557b2ab..2d57735 100644
@@ -163,7 +163,8 @@ static int preallocate_pmds(pmd_t *pmds[])
        bool failed = false;
 
        for(i = 0; i < PREALLOCATED_PMDS; i++) {
-               pmd_t *pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|

__GFP_REPEAT);
+ pmd_t *pmd;

+               pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
                if (pmd = NULL)
                        failed = true;
                pmds[i] = pmd;
#1 lore raw

Review

Quoted 9 lines · Michael Borisov

This patch fixes the following compile warning:

arch/x86/mm/pgtable.c: In function ‘pgd_mop_up_pmds’:
arch/x86/mm/pgtable.c:194: warning: unused variable ‘pmd’

- pmd_t *pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|
__GFP_REPEAT);

(quoted diff) +2 -0
+               pmd_t *pmd;
+               pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);

what gcc version are you using? Seems to be a compiler bug.

Ingo