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 X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6351FC433B4 for ; Fri, 9 Apr 2021 17:58:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C55F86108B for ; Fri, 9 Apr 2021 17:58:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C55F86108B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUvOS-0008MS-FW for qemu-devel@archiver.kernel.org; Fri, 09 Apr 2021 13:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUvNW-0007ut-I9 for qemu-devel@nongnu.org; Fri, 09 Apr 2021 13:57:11 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:44021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUvNT-00017l-9Z for qemu-devel@nongnu.org; Fri, 09 Apr 2021 13:57:10 -0400 Received: by mail-pj1-x102c.google.com with SMTP id x21-20020a17090a5315b029012c4a622e4aso3582329pjh.2 for ; Fri, 09 Apr 2021 10:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JCXs8G8k/P/VUzD2FIP2qjuzYjeDR3xbVJNiYhuk2Q4=; b=cnCtL1NHYOFnS308NhM6xOndrh/pCddKQ6ONHZ4BWy91qf/PuekOFpem5NaK2lKeF8 FYFzjkxccU2dzos3LQl1mTe8e+bnti5PrCgqJEU9QZQQajsa9behqmZugig9TJfVQDzp WSKBT9WSNULXm/7Ud0iULm+ZMw4rabANmb1n1YiSMjvSJBJpjeEdApwXKVXFCc03G8iL CwPENN/EV3LE2HKtORerIc5WyxZA8rpCHA4ha5SB1jRt9Jf9DMh0KsB6QMaQiNea9PAi s38fIaA49WDZSk2usuIHqwL69Y38hwU0yQF8dAaRj2womOrh20p4zGnd4jpxcEQ7Mp35 kSag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JCXs8G8k/P/VUzD2FIP2qjuzYjeDR3xbVJNiYhuk2Q4=; b=XvRMJEWhvruI2ZNMzSLiQWO+Q3DHxrqCEtIi9SmZV+fPDfbM8otQhSsLAPAcMaOUBf wbiRiefuNP3wOUN5Ixhf+8XR8Si0f8Qy8/avSL/R4ubhKM03PKWoC66ui5vzRXCIbKgt y4SlYUkYZv6YkFXs7FeOV+iDM/1fCdFWz+rjBo/bo5B1UnUFBZ22izPJWqd9qZ/G1X7z 7L289nQGEfeSB/yIDNgK24mKOrB78I8xlhAkb7BxSx7UwZ2TynyN+fUx+Z8ExCHXVyST RvQe3t4FxnmRmDtAYmMdHb5GdO+gA0dYco8NyHq5mUJ+OeQkPdglF2vGGx1C+T2b+ydq FD4g== X-Gm-Message-State: AOAM530ZyVa0o4Ajg/WsiYE3MkWEgOlpOQngkHWjUxmv12fE6dRB9WMg v9M9tcKItfMTVCziyHigbe0= X-Google-Smtp-Source: ABdhPJwgxO0paXbQQI72U9XuQM0I/47Xxsfp1ZcbJRLF8yDurdnTF2GHr1zLmy7oVvAifFqZ1sFD+A== X-Received: by 2002:a17:90b:ecc:: with SMTP id gz12mr14801433pjb.79.1617991025245; Fri, 09 Apr 2021 10:57:05 -0700 (PDT) Received: from localhost ([192.55.55.43]) by smtp.gmail.com with ESMTPSA id x1sm2811611pje.40.2021.04.09.10.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 10:57:04 -0700 (PDT) Date: Fri, 9 Apr 2021 10:55:12 -0700 From: Isaku Yamahata To: Greg Kurz Subject: Re: [PATCH] checkpatch: Fix use of uninitialized value Message-ID: <20210409175512.GB218869@ls> References: <161786467973.295167.5612704777283969903.stgit@bahia.lan> <20210408174913.GA218869@ls> <20210409074011.12ea4ed2@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210409074011.12ea4ed2@bahia.lan> Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=isaku.yamahata@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: isaku.yamahata@intel.com, Peter Maydell , qemu-devel@nongnu.org, Isaku Yamahata , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, Apr 09, 2021 at 07:40:11AM +0200, Greg Kurz wrote: > On Thu, 8 Apr 2021 10:49:13 -0700 > Isaku Yamahata wrote: > > > > > How about initializing them explicitly as follows? > > ($realfile ne '') prevents the case realfile eq '' && acpi_testexpted eq ''. > > Anyway your patch also should fix it. So > > Reviewed-by: Isaku Yamahata > > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > index 8f7053ec9b..2eb894a628 100755 > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -1325,8 +1325,8 @@ sub process { > > my %suppress_whiletrailers; > > my %suppress_export; > > > > - my $acpi_testexpected; > > - my $acpi_nontestexpected; > > + my $acpi_testexpected = ''; > > + my $acpi_nontestexpected = ''; > > > > Hmm... I haven't tried but I believe this will break when these are > passed to checkfilename() : > > sub checkfilename { > my ($name, $acpi_testexpected, $acpi_nontestexpected) = @_; > [...] > if (defined $$acpi_testexpected and defined $$acpi_nontestexpected) { > ERROR("Do not add expected files together with tests, " . > > > > # Pre-scan the patch sanitizing the lines. Oops. You're right. I scratch it. -- Isaku Yamahata