From cdf8d75818e3cd30746d38f5fbcdb3745fd267a3 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Thu, 14 Nov 2013 10:14:37 +0000 Subject: [PATCH] metag: dma: remove dead code in dma_alloc_init() Meta has 2 levels of page table so the pmd folds into the pud which folds into the pgd. Therefore the !pmd check in dma_alloc_init() is dead code since it essentially checks whether: (init_mm->pgd + 0x770) == 0 Remove the check. Reported-by: Chen Gang Signed-off-by: James Hogan --- arch/metag/kernel/dma.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c index db589ad5dbc..c700d625067 100644 --- a/arch/metag/kernel/dma.c +++ b/arch/metag/kernel/dma.c @@ -399,11 +399,6 @@ static int __init dma_alloc_init(void) pgd = pgd_offset(&init_mm, CONSISTENT_START); pud = pud_alloc(&init_mm, pgd, CONSISTENT_START); pmd = pmd_alloc(&init_mm, pud, CONSISTENT_START); - if (!pmd) { - pr_err("%s: no pmd tables\n", __func__); - ret = -ENOMEM; - break; - } WARN_ON(!pmd_none(*pmd)); pte = pte_alloc_kernel(pmd, CONSISTENT_START); -- 2.43.2