Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1659352imi; Sat, 23 Jul 2022 12:56:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1seXxO9wA3x6XusihMuXu4x2Fz+6HszsPYtyFr4OAsZeDAuX59Rvjl0j72nqcs4EelMjl3w X-Received: by 2002:a17:907:2d0b:b0:72b:978a:c6df with SMTP id gs11-20020a1709072d0b00b0072b978ac6dfmr4465120ejc.618.1658606163300; Sat, 23 Jul 2022 12:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658606163; cv=none; d=google.com; s=arc-20160816; b=vas0frR12Hd0y6c/RUeJToEXDUsiyo7WNmnsOZ9VGSBvjZ9NJQ7zpf9I4jhir44pHC NqUo9BhN3sfXOCXnNj5FnD3L1Lti2BFtyrdmmOeb/SQ5yj41YAi4dOLTUmRe1UeOv3gl kZQ1yjzchi0kQvedLTQPhT0oX3tbDuL0huPWX1Au6Bqg56o3tKRJ10pO0nnsbAZV1EVl 6K5pPiyasp3cn/iN/h1bQfMab+EPxCrsxLtJ4HcQ2YDlsx86/QtRfJa672HH3TvtvDco mVb19sRlT5o/iAaXhhooBaJeywIT6DNkDutwZfvxDYVLhx1BF5FqccCvVB4bQDUEeENh Cejg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CMxMFYDATndjCbxp/oEhhOYw+gGIXxYAqAFMeQcghNU=; b=Qe0X72O/mDIdx1XJ9Jk3BMpIuBY5eI8cRvVbBb7R+Z8vGPQLHwn5+CkW15cSezM9ws noAy6sEdd5nF07KXLWzpXf38jV2oDkSobETKwtj1kqVADe/tdJXesjey6a+nkKwlyJF9 kJWz7kZOzRDgtat2QFOQOc+NY0kuhaOPxziNE3Mc99f7peh/esMSjh8jnMq9sZm1keY/ qXlQ2PK+oEA5LiLz2xWF3QVInq1y+1F0o+nR53+zD74um/jdbo1m68QxT7zEqyJ605QE YMrXC6w5MgdDouYVhnW6UwnrErW/+WJURns+hWsz/DvncX06iDLKL0JVsYyzTjHM33OE eCSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a17090699c100b0072f703af475si11434464ejn.924.2022.07.23.12.55.11; Sat, 23 Jul 2022 12:56:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236614AbiGWT3z (ORCPT + 99 others); Sat, 23 Jul 2022 15:29:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231370AbiGWT3y (ORCPT ); Sat, 23 Jul 2022 15:29:54 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E96DE1B7B7 for ; Sat, 23 Jul 2022 12:29:51 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 26NJMEw8012545; Sat, 23 Jul 2022 14:22:15 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 26NJMBU3012544; Sat, 23 Jul 2022 14:22:11 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Sat, 23 Jul 2022 14:22:11 -0500 From: Segher Boessenkool To: Michal =?iso-8859-1?Q?Such=E1nek?= Cc: Jason Wang , lkp@intel.com, linux-kernel@vger.kernel.org, npiggin@gmail.com, Julia.Lawall@inria.fr, paulus@samba.org, joel@jms.id.au, linuxppc-dev@lists.ozlabs.org, hbathini@linux.ibm.com Subject: Re: [PATCH] powerpc: Remove the static variable initialisations to 0 Message-ID: <20220723192211.GP25951@gate.crashing.org> References: <20220723092436.7149-1-wangborong@cdjrlc.com> <20220723133405.GF17705@kitsune.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220723133405.GF17705@kitsune.suse.cz> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 23, 2022 at 03:34:05PM +0200, Michal Such?nek wrote: > Hello, > > On Sat, Jul 23, 2022 at 05:24:36PM +0800, Jason Wang wrote: > > Initialise global and static variable to 0 is always unnecessary. > > Remove the unnecessary initialisations. > > Isn't this change also unnecessary? > > Initializing to 0 does not affect correctness, or even any kind of > semantics in any way. It did make a difference when the kernel was still compiled with -fcommon (which used to be the GCC default on most configurations, it is traditional on Unix). No explicit initialiser puts an object in .bss if you use -fcommon. This matters a bit for data layout. > The current code is slightly easier to understand. > > And changing the code introduces history noise for na gain. Yup. This does give you some code golf points of course ;-) Segher