Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1690173pxm; Sat, 26 Feb 2022 23:57:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIOof/lxvTy5nYfkl8gXqzXQpOWcHZrcbaYHdpH9UokYWCuY816AORUFo4xZ53mg6IMgBR X-Received: by 2002:a05:6402:4245:b0:410:ee7d:8f0b with SMTP id g5-20020a056402424500b00410ee7d8f0bmr14211552edb.295.1645948633946; Sat, 26 Feb 2022 23:57:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645948633; cv=none; d=google.com; s=arc-20160816; b=H4iFmu8eZiD8vHZUDCzDj1b8TrZI73SYKfkFCnN/Fn0uyBKImrCKgLyEdr/jD8OGoT 6mZVDPkfITW+au+DsjUB5zVMVf4tzcwa/KKX6XOv8X0IfZKKsUmEzNog0fxSdhDTw7gy uCjAFYz7Smc5uND9yBnTV8x2io6kRgubc6XTStAfEnwf17CB+DQgN7UqagUhMjjajHbY QiPBm3pUf3/yi5Uyht2ofNIGURrMes25hBqhVr8l9lXmXDsj8AW4CzK0jcgrQp6a5Ib5 2BLjBa0aqFi0jYQnfdPgnw0aZWgUb4J/IknPlc5XKh2featkN0JoSLhQ52+UlwBOvR8O IN8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=vphasOzpgm5Yq544WPQ/ZojCKc5Fazniee0WirW3ZRg=; b=vC1MCTl2AtzC9cb/eJW9WMp/mKKCeSFi7n0uEGFdYk74UcJp98ZNwtrHclUSOwo1J/ QEB3oxBCNuyTMKlA+9iuXJP+yNg2JvDtKRkBYZ5Zl4tjsxPU0NwN89MbgjgQ5D3AxsDx TufR/zpIp5ej9/c4+GUMt60U6Ka+2cGU2VtagStNLairF91ObuyfEfgrlODQO/F210iA Dd/qcf2iCL3q47/qw2JzIcaljPlVVukymg/iEpjQbyzSK9GrtR1r58wl8aZy5rf3qT0K AZI+ZCi6mGBFD5hNyPc6F1odpi7BJBcwRMOy12RAb/5YmJy6coDK1oTKl1BngqDOziuO U6RQ== 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 hb40-20020a170907162800b006ceddad109csi4395750ejc.695.2022.02.26.23.56.40; Sat, 26 Feb 2022 23:57:13 -0800 (PST) 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 S230096AbiB0Hsg (ORCPT + 99 others); Sun, 27 Feb 2022 02:48:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbiB0Hsd (ORCPT ); Sun, 27 Feb 2022 02:48:33 -0500 Received: from relay3.hostedemail.com (relay3.hostedemail.com [64.99.140.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3107F5006C for ; Sat, 26 Feb 2022 23:47:54 -0800 (PST) Received: from omf14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 74D81220DE; Sun, 27 Feb 2022 07:47:53 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf14.hostedemail.com (Postfix) with ESMTPA id 173C72F; Sun, 27 Feb 2022 07:47:31 +0000 (UTC) Message-ID: <5aae43769bced6d5c17f143332004285af6d1c4d.camel@perches.com> Subject: Re: [PATCH 1/2] ALSA: core: remove initialise static variables to 0 From: Joe Perches To: Meng Tang , perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Date: Sat, 26 Feb 2022 23:47:51 -0800 In-Reply-To: <20220227071253.28193-1-tangmeng@uniontech.com> References: <20220227071253.28193-1-tangmeng@uniontech.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,FROM_FMBLA_NEWDOM, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: 8xnixydnu3zmz4hwsd8h1xfo3msdj6f6 X-Rspamd-Server: rspamout04 X-Rspamd-Queue-Id: 173C72F X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+2xEQu8yUXGYkYqv//dyUnZLZR68nqb9I= X-HE-Tag: 1645948051-399840 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 Sun, 2022-02-27 at 15:12 +0800, Meng Tang wrote: > Initializing the static variable to 0 causes the following error > when exec checkpatch: > > ERROR: do not initialise statics to 0 > FILE: sound/sound_core.c:142: > static int preclaim_oss = 0; > > Static variable does not need to be initialised to 0, because > compiler will initialise all uninitialised statics to 0. Thus, > remove the unneeded initializations. [] > diff --git a/sound/sound_core.c b/sound/sound_core.c [] > @@ -139,7 +139,7 @@ struct sound_unit > #ifdef CONFIG_SOUND_OSS_CORE_PRECLAIM > static int preclaim_oss = 1; > #else > -static int preclaim_oss = 0; > +static int preclaim_oss; > #endif Probably better without the #ifdef / #else / #endif as static int preclaim_oss = IS_ENABLED(CONFIG_SOUND_OSS_CORE_PRECLAIM);