From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47F08C433F5 for ; Thu, 18 Nov 2021 11:09:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D79FB61A56 for ; Thu, 18 Nov 2021 11:09:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D79FB61A56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 752A86B0073; Thu, 18 Nov 2021 06:09:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7035D6B0078; Thu, 18 Nov 2021 06:09:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F2036B007B; Thu, 18 Nov 2021 06:09:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 523BA6B0073 for ; Thu, 18 Nov 2021 06:09:47 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CECF3869B5 for ; Thu, 18 Nov 2021 11:09:36 +0000 (UTC) X-FDA: 78821780352.13.89BDED3 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf29.hostedemail.com (Postfix) with ESMTP id 229E2900026E for ; Thu, 18 Nov 2021 11:09:35 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EAB671FB; Thu, 18 Nov 2021 03:09:35 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C2123F5A1; Thu, 18 Nov 2021 03:09:33 -0800 (PST) Date: Thu, 18 Nov 2021 11:09:31 +0000 From: Mark Rutland To: Marco Elver Cc: "Paul E. McKenney" , Alexander Potapenko , Boqun Feng , Borislav Petkov , Dmitry Vyukov , Ingo Molnar , Josh Poimboeuf , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , kasan-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: Re: [PATCH v2 02/23] kcsan: Remove redundant zero-initialization of globals Message-ID: <20211118110931.GB5233@lakrids.cambridge.arm.com> References: <20211118081027.3175699-1-elver@google.com> <20211118081027.3175699-3-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211118081027.3175699-3-elver@google.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 229E2900026E X-Stat-Signature: e3e7nzw5mew1m5dhrpuc8rtz3reohf6r Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of mark.rutland@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=mark.rutland@arm.com; dmarc=pass (policy=none) header.from=arm.com X-HE-Tag: 1637233775-861191 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 18, 2021 at 09:10:06AM +0100, Marco Elver wrote: > They are implicitly zero-initialized, remove explicit initialization. > It keeps the upcoming additions to kcsan_ctx consistent with the rest. > > No functional change intended. > > Signed-off-by: Marco Elver > --- > init/init_task.c | 9 +-------- > kernel/kcsan/core.c | 5 ----- > 2 files changed, 1 insertion(+), 13 deletions(-) > > diff --git a/init/init_task.c b/init/init_task.c > index 2d024066e27b..61700365ce58 100644 > --- a/init/init_task.c > +++ b/init/init_task.c > @@ -181,14 +181,7 @@ struct task_struct init_task > .kasan_depth = 1, > #endif > #ifdef CONFIG_KCSAN > - .kcsan_ctx = { > - .disable_count = 0, > - .atomic_next = 0, > - .atomic_nest_count = 0, > - .in_flat_atomic = false, > - .access_mask = 0, > - .scoped_accesses = {LIST_POISON1, NULL}, > - }, > + .kcsan_ctx = { .scoped_accesses = {LIST_POISON1, NULL} }, I'd recommend leaving this as: .kcsan_ctx = { .scoped_accesses = {LIST_POISON1, NULL}, }, ... which'd be consistent with the DEFINE_PER_CPU() usage below, and makes it easier to add fields to in future without needing structural changes. Either way: Acked-by: Mark Rutland > #endif > #ifdef CONFIG_TRACE_IRQFLAGS > .softirqs_enabled = 1, > diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c > index 6bfd3040f46b..e34a1710b7bc 100644 > --- a/kernel/kcsan/core.c > +++ b/kernel/kcsan/core.c > @@ -44,11 +44,6 @@ bool kcsan_enabled; > > /* Per-CPU kcsan_ctx for interrupts */ > static DEFINE_PER_CPU(struct kcsan_ctx, kcsan_cpu_ctx) = { > - .disable_count = 0, > - .atomic_next = 0, > - .atomic_nest_count = 0, > - .in_flat_atomic = false, > - .access_mask = 0, > .scoped_accesses = {LIST_POISON1, NULL}, > }; > > -- > 2.34.0.rc2.393.gf8c9666880-goog >