Skip to contentSkip to conversation

sh: use kmem_cache_zalloc instead of kmem_cache_alloc with GFP_ZERO flag

PATCH New Emin Ghuliev 1 participant 1 message Aug 29, 2020 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: use kmem_cache_zalloc instead of kmem_cache_alloc with GFP_ZERO flag

use kmem_cache_zalloc function which does kmem_cache_alloc and zero out instead of manually setting kmem_cache_alloc with GFP_ZERO flag.

---
 arch/sh/mm/pgtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/mm/pgtable.c +1 -1
index cf7ce4b57359..6e17d921f5f5 100644
@@ -47,7 +47,7 @@ void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
 
 pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	return kmem_cache_alloc(pmd_cachep, GFP_KERNEL | __GFP_ZERO);
+	return kmem_cache_zalloc(pmd_cachep, GFP_KERNEL);
 }
 
 void pmd_free(struct mm_struct *mm, pmd_t *pmd)
Signature · 1 line
2.17.1