Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Xiu Jianfeng and committed by
Peter Zijlstra
e204193b 54dff232

+1 -4
+1 -4
kernel/locking/lockdep.c
··· 6011 6011 6012 6012 static void reinit_class(struct lock_class *class) 6013 6013 { 6014 - void *const p = class; 6015 - const unsigned int offset = offsetof(struct lock_class, key); 6016 - 6017 6014 WARN_ON_ONCE(!class->lock_entry.next); 6018 6015 WARN_ON_ONCE(!list_empty(&class->locks_after)); 6019 6016 WARN_ON_ONCE(!list_empty(&class->locks_before)); 6020 - memset(p + offset, 0, sizeof(*class) - offset); 6017 + memset_startat(class, 0, key); 6021 6018 WARN_ON_ONCE(!class->lock_entry.next); 6022 6019 WARN_ON_ONCE(!list_empty(&class->locks_after)); 6023 6020 WARN_ON_ONCE(!list_empty(&class->locks_before));