qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] checkpatch: Fix use of uninitialized value


From: Isaku Yamahata
Subject: Re: [PATCH] checkpatch: Fix use of uninitialized value
Date: Fri, 9 Apr 2021 10:55:12 -0700

On Fri, Apr 09, 2021 at 07:40:11AM +0200,
Greg Kurz <groug@kaod.org> wrote:

> On Thu, 8 Apr 2021 10:49:13 -0700
> Isaku Yamahata <isaku.yamahata@gmail.com> 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 <isaku.yamahata@intel.com>
> > 
> > 
> > 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 <isaku.yamahata@gmail.com>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]