* Re: checkpatch.pl false positive
[not found] <DC148C5AA1CEBA4E87973D432B1C2D8825F13B6F@P3PWEX4MB008.ex4.secureserver.net>
@ 2014-07-22 19:23 ` Joe Perches
2014-07-22 19:46 ` Hartley Sweeten
2014-07-23 4:31 ` [PATCH] checkpatch: Fix false positives for --strict "space after cast" test Joe Perches
0 siblings, 2 replies; 3+ messages in thread
From: Joe Perches @ 2014-07-22 19:23 UTC (permalink / raw)
To: Hartley Sweeten; +Cc: Andy Whitcroft, LKML
On Tue, 2014-07-22 at 17:30 +0000, Hartley Sweeten wrote:
> Joe,
>
> I think this is a false positive, at least the check message appears
> incorrect:
>
> CHECK: No space is necessary after a cast
> #66: FILE: arch/arm/mach-ep93xx/include/mach/platform.h:66:
> +static inline int crunch_init(void) { return 0; }
Yeah, it's a false positive introduced by -next
commit 89da401f6cff ("checkpatch: improve "no space after cast" test")
Try this?
---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2258497..644c2d5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2418,7 +2418,7 @@ sub process {
}
}
- if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
+ if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) {
if (CHK("SPACING",
"No space is necessary after a cast\n" . $herecurr) &&
$fix) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: checkpatch.pl false positive
2014-07-22 19:23 ` checkpatch.pl false positive Joe Perches
@ 2014-07-22 19:46 ` Hartley Sweeten
2014-07-23 4:31 ` [PATCH] checkpatch: Fix false positives for --strict "space after cast" test Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Hartley Sweeten @ 2014-07-22 19:46 UTC (permalink / raw)
To: Joe Perches; +Cc: Andy Whitcroft, LKML
On Tuesday, July 22, 2014 12:23 PM, Joe Perches wrote:
> On Tue, 2014-07-22 at 17:30 +0000, Hartley Sweeten wrote:
>> Joe,
>>
>> I think this is a false positive, at least the check message appears
>> incorrect:
>>
>> CHECK: No space is necessary after a cast
>> #66: FILE: arch/arm/mach-ep93xx/include/mach/platform.h:66:
>> +static inline int crunch_init(void) { return 0; }
>
> Yeah, it's a false positive introduced by -next
> commit 89da401f6cff ("checkpatch: improve "no space after cast" test")
>
> Try this?
> ---
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2258497..644c2d5 100755
> --- a/scripts/checkpatch.pl
>+++ b/scripts/checkpatch.pl
> @ @ -2418,7 +2418,7 @@ sub process {
> }
> }
>
> - if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
> + if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) {
> if (CHK("SPACING",
> "No space is necessary after a cast\n" . $herecurr) &&
> $fix) {
That fixed it.
Thanks,
Hartley
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] checkpatch: Fix false positives for --strict "space after cast" test
2014-07-22 19:23 ` checkpatch.pl false positive Joe Perches
2014-07-22 19:46 ` Hartley Sweeten
@ 2014-07-23 4:31 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2014-07-23 4:31 UTC (permalink / raw)
To: Andrew Morton; +Cc: Hartley Sweeten, Andy Whitcroft, LKML
commit 89da401f6cff ("checkpatch: improve "no space after cast" test")
in -next improved the cast test for non pointer types, but also
introduced false positives for some types of static inlines.
Add a test for an open brace to the exclusions to avoid these
false positives.
Reported-by: Hartley Sweeten <HartleyS@visionengravers.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index dc72a9b..7dcfc75 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2418,7 +2418,7 @@ sub process {
}
}
- if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
+ if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) {
if (CHK("SPACING",
"No space is necessary after a cast\n" . $herecurr) &&
$fix) {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-23 4:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <DC148C5AA1CEBA4E87973D432B1C2D8825F13B6F@P3PWEX4MB008.ex4.secureserver.net>
2014-07-22 19:23 ` checkpatch.pl false positive Joe Perches
2014-07-22 19:46 ` Hartley Sweeten
2014-07-23 4:31 ` [PATCH] checkpatch: Fix false positives for --strict "space after cast" test Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®