[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240829085552.157119-1-ruanjinjie@huawei.com>
Date: Thu, 29 Aug 2024 16:55:52 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <linux-kernel@...r.kernel.org>, <dave@...lcore.net>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH -next RESEND] uts: Use KMEM_CACHE_USERCOPY() helper
Use KMEM_CACHE_USERCOPY() macro to simplify code.
Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.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
Powered by blists - more mailing lists