mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] x86: remove redundant check for kmem_cache_create()
@ 2018-06-12 11:48 Chengguang Xu
  2018-08-02 12:31 ` [tip:x86/mm] x86/mm: Remove " tip-bot for Chengguang Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2018-06-12 11:48 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 for cache creation.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
v1->v2:
- Keep return type as int instead of changing to void.

 arch/x86/mm/pgtable.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 47b5951..406873d 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -329,9 +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] 2+ messages in thread

end of thread, other threads:[~2018-08-02 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 11:48 [PATCH v2] x86: remove redundant check for kmem_cache_create() Chengguang Xu
2018-08-02 12:31 ` [tip:x86/mm] x86/mm: Remove " tip-bot for Chengguang Xu

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

Powered by JetHome