Skip to content

Commit e204193

Browse files
Xiu JianfengPeter Zijlstra
authored andcommitted
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
1 parent 54dff23 commit e204193

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

kernel/locking/lockdep.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6011,13 +6011,10 @@ static void zap_class(struct pending_free *pf, struct lock_class *class)
60116011

60126012
static void reinit_class(struct lock_class *class)
60136013
{
6014-
void *const p = class;
6015-
const unsigned int offset = offsetof(struct lock_class, key);
6016-
60176014
WARN_ON_ONCE(!class->lock_entry.next);
60186015
WARN_ON_ONCE(!list_empty(&class->locks_after));
60196016
WARN_ON_ONCE(!list_empty(&class->locks_before));
6020-
memset(p + offset, 0, sizeof(*class) - offset);
6017+
memset_startat(class, 0, key);
60216018
WARN_ON_ONCE(!class->lock_entry.next);
60226019
WARN_ON_ONCE(!list_empty(&class->locks_after));
60236020
WARN_ON_ONCE(!list_empty(&class->locks_before));

0 commit comments

Comments
 (0)