mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND PATCH] x86: remove redundant check for kmem_cache_create()
@ 2018-06-12 10:16 Chengguang Xu
  2018-06-12 11:27 ` kbuild test robot
  2018-06-12 14:33 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Chengguang Xu @ 2018-06-12 10:16 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: x86, linux-kernel, Chengguang Xu

The flag 'SLAB_PANIC' implies panic when encouter failure,
so there is no need to check NULL pointer and return error
code.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 arch/x86/mm/pgtable.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 47b5951..4392414 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -312,14 +312,14 @@ static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[])
 
 static struct kmem_cache *pgd_cache;
 
-static int __init pgd_cache_init(void)
+static void __init pgd_cache_init(void)
 {
 	/*
 	 * When PAE kernel is running as a Xen domain, it does not use
 	 * shared kernel pmd. And this requires a whole page for pgd.
 	 */
 	if (!SHARED_KERNEL_PMD)
-		return 0;
+		return;
 
 	/*
 	 * when PAE kernel is not running as a Xen domain, it uses
@@ -329,10 +329,6 @@ static int __init pgd_cache_init(void)
 	 */
 	pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_ALIGN,
 				      SLAB_PANIC, NULL);
-	if (!pgd_cache)
-		return -ENOMEM;
-
-	return 0;
 }
 core_initcall(pgd_cache_init);
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-12 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 10:16 [RESEND PATCH] x86: remove redundant check for kmem_cache_create() Chengguang Xu
2018-06-12 11:27 ` kbuild test robot
2018-06-12 14:33 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®