[PATCH -next] uts: Use KMEM_CACHE_USERCOPY() helper

Jinjie Ruan posted 1 patch 1 year, 3 months ago
There is a newer version of this series
kernel/utsname.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
[PATCH -next] uts: Use KMEM_CACHE_USERCOPY() helper
Posted by Jinjie Ruan 1 year, 3 months ago
Use KMEM_CACHE_USERCOPY() macro to simplify code.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 kernel/utsname.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/utsname.c b/kernel/utsname.c
index b1ac3ca870f2..b9917ea6142d 100644
--- a/kernel/utsname.c
+++ b/kernel/utsname.c
@@ -168,10 +168,5 @@ const struct proc_ns_operations utsns_operations = {
 
 void __init uts_ns_init(void)
 {
-	uts_ns_cache = kmem_cache_create_usercopy(
-			"uts_namespace", sizeof(struct uts_namespace), 0,
-			SLAB_PANIC|SLAB_ACCOUNT,
-			offsetof(struct uts_namespace, name),
-			sizeof_field(struct uts_namespace, name),
-			NULL);
+	uts_ns_cache = KMEM_CACHE_USERCOPY(uts_namespace, SLAB_PANIC | SLAB_ACCOUNT, name);
 }
-- 
2.34.1