linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Joe Perches <joe@perches.com>
Cc: Gerhard Sittig <gsi@denx.de>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] checkpatch: Fix "Use of uninitialized value" warnings
Date: Mon, 18 Nov 2013 14:31:35 +0000	[thread overview]
Message-ID: <20131118143135.GF3126@dm> (raw)
In-Reply-To: <1384782664.5814.17.camel@joe-AO722>

On Mon, Nov 18, 2013 at 05:51:04AM -0800, Joe Perches wrote:
> checkpatch is currently confused about some complex macros
> and references undefined variables $stat and $cond.
> 
> Make sure these are defined before using them.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  scripts/checkpatch.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 61090e0..9c981003 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3289,6 +3289,7 @@ sub process {
>  			}
>  		}
>  		if (!defined $suppress_whiletrailers{$linenr} &&
> +		    defined($stat) && defined($cond) &&
>  		    $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {
>  			my ($s, $c) = ($stat, $cond);

Seems reasonable indeed.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw

      reply	other threads:[~2013-11-18 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 11:45 checkpatch.pl "Use of uninitialized value" warnings Gerhard Sittig
2013-11-18 13:51 ` [PATCH] checkpatch: Fix " Joe Perches
2013-11-18 14:31   ` Andy Whitcroft [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131118143135.GF3126@dm \
    --to=apw@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=gsi@denx.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).