public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* checkpatch confused by pre-existing #endif
@ 2009-01-13 21:57 Pavel Roskin
  2009-01-14 16:45 ` Andy Whitcroft
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Roskin @ 2009-01-13 21:57 UTC (permalink / raw)
  To: Andy Whitcroft, linux-kernel

Hello!

This patch confuses checkpatch.pl from Linux 2.6.29-rc1:

====================
--- foo.h.old	2009-01-13 16:48:22.000000000 -0500
+++ foo.h	2009-01-13 16:48:18.000000000 -0500
@@ -3,4 +3,8 @@
 
 
 
+#ifdef FOOBAR
+#define foo
+#endif
+
 #endif /* FOO_H */
====================

$ scripts/checkpatch.pl foo.diff 
Can't use an undefined value as an ARRAY reference at
scripts/checkpatch.pl line 453.

Apparently, the last #endif causes some data to be popped from the stack
for preprocessor directives.  However, the corresponding #ifdef is
outside the patch, so this fails.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: checkpatch confused by pre-existing #endif
  2009-01-13 21:57 checkpatch confused by pre-existing #endif Pavel Roskin
@ 2009-01-14 16:45 ` Andy Whitcroft
  2009-01-14 16:49   ` Pavel Roskin
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Whitcroft @ 2009-01-14 16:45 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-kernel

On Tue, Jan 13, 2009 at 04:57:43PM -0500, Pavel Roskin wrote:
> Hello!
> 
> This patch confuses checkpatch.pl from Linux 2.6.29-rc1:
> 
> ====================
> --- foo.h.old	2009-01-13 16:48:22.000000000 -0500
> +++ foo.h	2009-01-13 16:48:18.000000000 -0500
> @@ -3,4 +3,8 @@
>  
>  
>  
> +#ifdef FOOBAR
> +#define foo
> +#endif
> +
>  #endif /* FOO_H */
> ====================
> 
> $ scripts/checkpatch.pl foo.diff 
> Can't use an undefined value as an ARRAY reference at
> scripts/checkpatch.pl line 453.
> 
> Apparently, the last #endif causes some data to be popped from the stack
> for preprocessor directives.  However, the corresponding #ifdef is
> outside the patch, so this fails.

Yes this should be fixed in the changes pushed up to Andrew.  You can
confirm this using the version here:

  http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

-apw

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: checkpatch confused by pre-existing #endif
  2009-01-14 16:45 ` Andy Whitcroft
@ 2009-01-14 16:49   ` Pavel Roskin
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Roskin @ 2009-01-14 16:49 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: linux-kernel

On Wed, 2009-01-14 at 16:45 +0000, Andy Whitcroft wrote:

> Yes this should be fixed in the changes pushed up to Andrew.  You can
> confirm this using the version here:
> 
>   http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

It's working fine on the ath9k patchset where the issue was discovered.
Thank you!

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-14 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13 21:57 checkpatch confused by pre-existing #endif Pavel Roskin
2009-01-14 16:45 ` Andy Whitcroft
2009-01-14 16:49   ` Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox