All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] checkpatch: nested structs
@ 2008-04-08 14:55 Jan Engelhardt
  2008-04-08 17:35 ` Andy Whitcroft
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2008-04-08 14:55 UTC (permalink / raw)
  To: apw; +Cc: linux-kernel

This is required for nested struct/union compounds.
---
 scripts/checkpatch.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 58a9494..cf78e86 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1582,7 +1582,7 @@ sub process {
 
 # closing brace should have a space following it when it has anything
 # on the line
-		if ($line =~ /}(?!(?:,|;|\)))\S/) {
+		if ($line =~ /}+(?!(?:,|;|\)))\S/) {
 			ERROR("space required after that close brace '}'\n" . $herecurr);
 		}
 
-- 
1.5.5.rc3


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

* Re: [PATCH 1/1] checkpatch: nested structs
  2008-04-08 14:55 [PATCH 1/1] checkpatch: nested structs Jan Engelhardt
@ 2008-04-08 17:35 ` Andy Whitcroft
  2008-04-08 17:59   ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Whitcroft @ 2008-04-08 17:35 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-kernel

On Tue, Apr 08, 2008 at 04:55:30PM +0200, Jan Engelhardt wrote:
> This is required for nested struct/union compounds.
> ---
>  scripts/checkpatch.pl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 58a9494..cf78e86 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1582,7 +1582,7 @@ sub process {
>  
>  # closing brace should have a space following it when it has anything
>  # on the line
> -		if ($line =~ /}(?!(?:,|;|\)))\S/) {
> +		if ($line =~ /}+(?!(?:,|;|\)))\S/) {
>  			ERROR("space required after that close brace '}'\n" . $herecurr);
>  		}

If my eyes are not lying then you have added is a + after the first },
as this is an unanchored match I would expect that to match in exactly
the same places.  Hmm, well I guess that it would allow two or more close
braces to abutt.  Can you give me an example of somethign which would
require this?

-apw

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

* Re: [PATCH 1/1] checkpatch: nested structs
  2008-04-08 17:35 ` Andy Whitcroft
@ 2008-04-08 17:59   ` Jan Engelhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2008-04-08 17:59 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: linux-kernel


On Tuesday 2008-04-08 19:35, Andy Whitcroft wrote:
>>  # on the line
>> -		if ($line =~ /}(?!(?:,|;|\)))\S/) {
>> +		if ($line =~ /}+(?!(?:,|;|\)))\S/) {
>>  			ERROR("space required after that close brace '}'\n" . $herecurr);
>>  		}
>
>If my eyes are not lying then you have added is a + after the first },
>as this is an unanchored match I would expect that to match in exactly
>the same places.  Hmm, well I guess that it would allow two or more close
>braces to abutt.  Can you give me an example of somethign which would
>require this?

+#define E(a, b, c, d) \
+       {.ip6 = { \
+               __constant_htonl(a), __constant_htonl(b), \
+               __constant_htonl(c), __constant_htonl(d), \
+       }}

static const struct union nf_inet_addr some_address = E(20010db8,0,13,17);

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

end of thread, other threads:[~2008-04-08 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08 14:55 [PATCH 1/1] checkpatch: nested structs Jan Engelhardt
2008-04-08 17:35 ` Andy Whitcroft
2008-04-08 17:59   ` Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.