Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1921353pxa; Mon, 3 Aug 2020 02:41:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9mdiAAQDxtUbkj39C4gPyYgaNnwORStwG4zoZFY7OebS01G2ys8jxsvrgeyvX/1KcDWJ0 X-Received: by 2002:a17:906:4f82:: with SMTP id o2mr16343415eju.424.1596447680302; Mon, 03 Aug 2020 02:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596447680; cv=none; d=google.com; s=arc-20160816; b=YXk6w33Waaywtfz62wOD4LbeQtPSFpt35xSNmcE4kQ+z64YWCicZ/4xUYrKq2uy7FX MaaCowGsDVp1iMqZfP2e8Mf61yifZBhH9UTU4QUCncqbUeu72gu1jaM2P5gXipZIv5RH DRZsr9AkZ35Yf0vXeGAePaNtjf4eklocatiiZsWQyjujeEY8MyrjLAKohRv4sNUzFOg1 t+RjaY8BSWVVMdXOsY9ZjuNXUYwfhu0KBva7jEzlQ9sWTwPR3CuyJgRPBKapULRpeTvM dWCDBUlYfqy0TuisyLR5bJeVjrehVBKZuZyxlzKmiOnQQ9skDWsLcQA/dIoMhXc7j9J9 w87w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UbRjqa0bLC9sUnNplV+mhL8Jmlbwd8SnDkco5utAUSc=; b=YDSdSbG/1KdL209lXFjdp6IiX57u/TyI5I3TZ0Kdg1j8Of0EzXNofKfQvPjYsTp4F6 HKy2dvpFYTOjV2Ud38p3qfvDzP0heRlDbbkvo+b3ws5C+h5pBb4qd3KlqE7uSEaG41cO D+Af8cAiVKM0IrhpPNw2E7XiscUnm+gf5wSpAyBwm0kf5fvHxoS0DjaZvKzcr+KvoGI7 ITb6PxQr2gjDmRVg6b5Zjew5SG5p3dgqyTVZgxXh5y3AJRe9VdfNl2eD70ONhCJC2CT8 +iad3SUlDCpOVEJynPNJIBth2xfxZUxMxn9+OkX6ySng1Lw/hsp6w5DO3vRkg4iIpaGV ppIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZpPiDdU+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si755172ede.434.2020.08.03.02.40.57; Mon, 03 Aug 2020 02:41:20 -0700 (PDT) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZpPiDdU+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726069AbgHCJh5 (ORCPT + 99 others); Mon, 3 Aug 2020 05:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgHCJh5 (ORCPT ); Mon, 3 Aug 2020 05:37:57 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DCBDC06174A for ; Mon, 3 Aug 2020 02:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UbRjqa0bLC9sUnNplV+mhL8Jmlbwd8SnDkco5utAUSc=; b=ZpPiDdU+LOwUbCnqWeNDxyTS3P 83SJlXZhJQgAAwhUfujeYkdc6b/zHYQ4yD/THmovQlRkn0XwKrT067ZiIw8wCbF06UG78SPG8DbdW /6cNzRUkhcURd+0y/H1m/A5lHIp1r3RAfdUCVdc4ZrXEv4eW7gly+TRSgrQGpi+5oozDHH/M3QZDX NGVY5ox+e6i2aWawk4OJRkvsEQoTupMQmLiWoIbQZsNYgNWIDNTBrUS9vHcDYKksw8Hqp5ooPWCl3 rDnlzx1kExokVOXpGU0vSAzIZIbwYjm7yqEPBrLI7RNv/nCrjZn6Hguh/g72gbljQ6mlwXRtsVi6O TiT9gzDQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2Wun-0007dB-9T; Mon, 03 Aug 2020 09:37:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A23F3301A66; Mon, 3 Aug 2020 11:37:51 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 940C8236F1EB3; Mon, 3 Aug 2020 11:37:51 +0200 (CEST) Date: Mon, 3 Aug 2020 11:37:51 +0200 From: peterz@infradead.org To: Jules Irenge Cc: linux-kernel@vger.kernel.org, Frederic Weisbecker , Thomas Gleixner , Alexandre Chartre , Masami Hiramatsu Subject: Re: [PATCH 4/4] context_tracking: uninitialize static variables Message-ID: <20200803093751.GD2674@hirez.programming.kicks-ass.net> References: <0/4> <20200801184603.310769-1-jbi.octave@gmail.com> <20200801184603.310769-5-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200801184603.310769-5-jbi.octave@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 01, 2020 at 07:46:03PM +0100, Jules Irenge wrote: > Checkpatch tool reports an error at a staic variable declaration > > "ERROR: do not initialise statics to false" > > This is due to the fact that this variable is stored in the buffer > In the .bss section, one can not set an initial value > Here we can trust the compiler to automatically set them to false. > The variable has since been uninitialized. > > Signed-off-by: Jules Irenge > --- > kernel/context_tracking.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c > index 36a98c48aedc..21881c534152 100644 > --- a/kernel/context_tracking.c > +++ b/kernel/context_tracking.c > @@ -190,7 +190,7 @@ NOKPROBE_SYMBOL(context_tracking_user_exit); > > void __init context_tracking_cpu_set(int cpu) > { > - static __initdata bool initialized = false; > + static __initdata bool initialized; So personally I prefer having the '= false' there. It used to be that compilers were stupid and would put any initialized static variable in .data, even if it was initialized with 0. But AFAIK compilers are no longer that stupid.