aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/locking
diff options
context:
space:
mode:
authorXiu Jianfeng <xiujianfeng@huawei.com>2021-12-13 21:26:18 +0800
committerPeter Zijlstra <peterz@infradead.org>2022-01-25 22:30:27 +0100
commite204193b138af347fbbbe026e68cb3385112f387 (patch)
treec1b1dd372638dbadfe90dc62cb5e2069d4613d3d /kernel/locking
parent54dff232142e255ff644d73de1c8d80122f5ad7b (diff)
downloadlinux-e204193b138af347fbbbe026e68cb3385112f387.tar.gz
lockdep: Use memset_startat() helper in reinit_class()
use memset_startat() helper to simplify the code, there is no functional change in this patch. Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20211213132618.105737-1-xiujianfeng@huawei.com
Diffstat (limited to 'kernel/locking')
-rw-r--r--kernel/locking/lockdep.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 4a882f83aeb9d..89b3df51fd988 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -6011,13 +6011,10 @@ static void zap_class(struct pending_free *pf, struct lock_class *class)
static void reinit_class(struct lock_class *class)
{
- void *const p = class;
- const unsigned int offset = offsetof(struct lock_class, key);
-
WARN_ON_ONCE(!class->lock_entry.next);
WARN_ON_ONCE(!list_empty(&class->locks_after));
WARN_ON_ONCE(!list_empty(&class->locks_before));
- memset(p + offset, 0, sizeof(*class) - offset);
+ memset_startat(class, 0, key);
WARN_ON_ONCE(!class->lock_entry.next);
WARN_ON_ONCE(!list_empty(&class->locks_after));
WARN_ON_ONCE(!list_empty(&class->locks_before));