Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5495162pxb; Wed, 26 Jan 2022 13:23:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQVgwobqRu5vZYd1xxvRQUSSNNb+FpZHQRrJeuLIJxaIcjQdi28imVbNDFvqo2mrRlztkF X-Received: by 2002:a17:907:6283:: with SMTP id nd3mr558459ejc.2.1643232200021; Wed, 26 Jan 2022 13:23:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643232200; cv=none; d=google.com; s=arc-20160816; b=yAAVha1zLWvnOeizFyCCdgIFD6nphlM2yN8aBOOl6+F1lMLYI+Zl93woXAnn0xCUdQ Dl1isFN/MXOkbJ/ZuuqOCc0kS7q1j/Vi9x6kJn88RSUpfXrwMnvcX7Wb5pQlP8SX+TBi K8WIUkIMnKg9w4tx68sgIPXmk4fwNibihKxN+EBjHez6rzjO3+53d/vIOWuDwt96oGo2 /EPvWr/V+bVcRqv7LJ6btEhp3u6iccPNAqngKxK91WuOCGdSSZ1zcyURfrGkS04vr/f6 NZwLJCNMphqF9mbezl4L7tJTFdpM4UwqCHci+DXLwjRMeTe5iY4Vfrfl0UhBEhvqQka4 UXEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=3I4ChLYHGk093NXNmLne78ptnuGfPC6K8VKoX3iLCws=; b=KXxW592yhLF1FRzr0PWf4klk1I8w1wSex3Soop3C47bX4KRTDbQTVFUfxygAc8Wvxg eMpadyGys2LhpyGOE90zdQe3Ms5VIFT1iuvR3kPRZ+l4zAaW3v0OXd3Kx3v3O4UQ3OId 4WxDFvIJwh6P25+q7JHTJHo6CjxeLhqHXtmLq6g366psQSsH7PVEKlYLen4HeldXPFBy mSjQCbQdqBGQKp0KP0DmgO4Br3K32dum9u50KyRX8MIQ9gp333rAid1imYrMJ1P5Byiv 7lkCfMjYM/a2KKFbHCKHiZ5nv8sX3k8si22WMgi1UmX1Kd3DQx2QVr3iN5l+1ul0/wpV vURw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1+QGhL8u; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs36si202803ejc.463.2022.01.26.13.22.55; Wed, 26 Jan 2022 13:23:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1+QGhL8u; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239848AbiAZNap (ORCPT + 99 others); Wed, 26 Jan 2022 08:30:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239585AbiAZNac (ORCPT ); Wed, 26 Jan 2022 08:30:32 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C30CC061749; Wed, 26 Jan 2022 05:30:32 -0800 (PST) Date: Wed, 26 Jan 2022 13:30:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643203830; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3I4ChLYHGk093NXNmLne78ptnuGfPC6K8VKoX3iLCws=; b=1+QGhL8uyD8Owf1iU2s9QrNIQkeknAntZfAZDdVQX2j0Nnjj8ENXb/93Rmtl1VOPFknlUH EwyTXUQGwOianBgm9fFhJOzBxl/kdNgZAdNPVsPJG/40Xa2Hvo0VWLo6i/tWmTT0BkXpc8 G9B1+7LJ3P/wDWF3fBgqracGJHEkezdbrpuNlHPvKIpQrokIz5vpouPL/z+SNJ9gfTd+Sw 0dp+080v9Cu0GvF0tIYV35alycXVDTWI5Iazcr0pHdgNXruYH+v/6hjTQSQbhckzY8Wo/Y DnKsd/YPr/Dx8+T/hdVZg3cTC6nhgqqqbW34+0s+DITYX/+/OBPF6/jkEDx5iw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643203830; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3I4ChLYHGk093NXNmLne78ptnuGfPC6K8VKoX3iLCws=; b=CT4f5htCUHBtN8X4h6jvEvdraU9laUqugPhKYOYrOl2b7YpdbEPjspWR6X/3qzx7cPQvKf gqSDk+5OOS+DSyDg== From: "tip-bot2 for Xiu Jianfeng" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] lockdep: Use memset_startat() helper in reinit_class() Cc: Xiu Jianfeng , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20211213132618.105737-1-xiujianfeng@huawei.com> References: <20211213132618.105737-1-xiujianfeng@huawei.com> MIME-Version: 1.0 Message-ID: <164320382983.16921.16443534509567100814.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: e204193b138af347fbbbe026e68cb3385112f387 Gitweb: https://git.kernel.org/tip/e204193b138af347fbbbe026e68cb3385112f387 Author: Xiu Jianfeng AuthorDate: Mon, 13 Dec 2021 21:26:18 +08:00 Committer: Peter Zijlstra CommitterDate: Tue, 25 Jan 2022 22:30:27 +01:00 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 Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211213132618.105737-1-xiujianfeng@huawei.com --- kernel/locking/lockdep.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 4a882f8..89b3df5 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));