[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1428378769.20888.12.camel@perches.com>
Date: Mon, 06 Apr 2015 20:52:49 -0700
From: Joe Perches <joe@...ches.com>
To: Sam Bobroff <sam.bobroff@....ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, apw@...onical.com
Subject: Re: [PATCH 1/1] checkpatch: improve operator spacing check
On Tue, 2015-04-07 at 13:36 +1000, Sam Bobroff wrote:
> Code such as:
> x = timercmp(&now, &end, <);
> Will currently trigger a checkpatch error. e.g.
> ERROR: spaces required around that '<'
>
> This is because the "Ignore operators passed as parameters" check
> looks only for a comma following the operator. Improve the check by
> also looking for a close parenthesis.
>
> Signed-off-by: Sam Bobroff <sam.bobroff@....ibm.com>
Seems sensible, thanks.
> ---
>
> scripts/checkpatch.pl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d124359..f65c4de 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3565,7 +3565,7 @@ sub process {
>
> # Ignore operators passed as parameters.
> if ($op_type ne 'V' &&
> - $ca =~ /\s$/ && $cc =~ /^\s*,/) {
> + $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) {
>
> # # Ignore comments
> # } elsif ($op =~ /^$;+$/) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists