Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp688586ybt; Wed, 24 Jun 2020 08:51:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1ulLCIGOVlLit1VS0AOdkOyLq5xphaiE6DpHXLNrqjt192v574Q6RAGOPeLTP6fExu2uX X-Received: by 2002:a05:6402:22b0:: with SMTP id cx16mr20184807edb.48.1593013896637; Wed, 24 Jun 2020 08:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593013896; cv=none; d=google.com; s=arc-20160816; b=0BbRcM57PUbes7I40zlch1m4vhXd9w0IgnqktyBBoBRdsgXEMRnevkoQOBwf2g8cqz jVBvdqBVcfYwzaQ8OYFRZuq+ls9DU09TnwFlH+eUze0mqSziylbzg5WCXbmaFpMVHKUA A1sYTufc0AUgyoKe/KJhrwEzfHaDlT9bDQaZGQ6eXm2KnZloOYErJ0E/mVv2cUH0Us1X W2iPYWe4OZnY8hthk/1M6DxdnQWM+2pFwOvPV3U6cyrO3My+JKAmBuKhR0qF3AofgCCc 6k/yFYuBBsF0+PRCFDDV3cyPY1j8JiOqTsdJPgxiYl0uldqADzJJYBRQ1anWgPxm+Gsj +PCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gtA9UlC6UOa2WBH3iI7kgZhSNDsBzptNJAN3GC3WLc4=; b=q4U6Na3p1M6YPwL8N4Tj9HgNB05Fl77HXwcV68/MICcoCJPW9coOb8kYr5ae/eWThs aBYsgaumpusYGCeBtgAmwY2ZIF58/BQ6VX1X4TOvAiAVXeHDxq4GkMjnSl+5JjX9lM5t 4mRp2btG79BTxy/X3rARK3/t9eC7zUfeseaIfeHJvu/zIRqETxCzN0m/Zm9JrVlywJRL 2MQieC/3NxHjfGRDsX4SswXkydkYVvKaAM4e8kEjhrfLCn/d5ypEGPtqk6NgZU7Wih9t PaQUW2YQMFo05IZticJVgG6jZU27xzVMz2wvUdX6tMWgJpds4h35YZvjiBG/qABp7SUW W/oQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c15si4987787ejk.329.2020.06.24.08.51.12; Wed, 24 Jun 2020 08:51:36 -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; 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 S2404484AbgFXPuE (ORCPT + 99 others); Wed, 24 Jun 2020 11:50:04 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:55132 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404187AbgFXPuD (ORCPT ); Wed, 24 Jun 2020 11:50:03 -0400 Received: from 89-64-84-125.dynamic.chello.pl (89.64.84.125) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 3e5775f4173105c7; Wed, 24 Jun 2020 17:50:00 +0200 From: "Rafael J. Wysocki" To: Jason Yan Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Kees Cook Subject: Re: [PATCH] ACPI: Eliminate usage of uninitialized_var() macro Date: Wed, 24 Jun 2020 17:49:59 +0200 Message-ID: <2128012.4yIOnhsQJz@kreacher> In-Reply-To: <20200615040047.3535543-1-yanaijie@huawei.com> References: <20200615040047.3535543-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, June 15, 2020 6:00:47 AM CEST Jason Yan wrote: > This is an effort to eliminate the uninitialized_var() macro[1]. > > The use of this macro is the wrong solution because it forces off ANY > analysis by the compiler for a given variable. It even masks "unused > variable" warnings. > > Quoted from Linus[2]: > > "It's a horrible thing to use, in that it adds extra cruft to the > source code, and then shuts up a compiler warning (even the _reliable_ > warnings from gcc)." > > The gcc option "-Wmaybe-uninitialized" has been disabled and this change > will not produce any warnnings even with "make W=1". > > [1] https://github.com/KSPP/linux/issues/81 > [2] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ > > Cc: Kees Cook > Signed-off-by: Jason Yan > --- > drivers/acpi/acpi_pad.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c > index e7dc0133f817..6cc4c92d9ff9 100644 > --- a/drivers/acpi/acpi_pad.c > +++ b/drivers/acpi/acpi_pad.c > @@ -88,7 +88,7 @@ static void round_robin_cpu(unsigned int tsk_index) > cpumask_var_t tmp; > int cpu; > unsigned long min_weight = -1; > - unsigned long uninitialized_var(preferred_cpu); > + unsigned long preferred_cpu; > > if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) > return; > Applied as 5.9 material, thanks!