All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: remove unneeded or ("|")
@ 2015-03-12 14:07 Christian Borntraeger
  2015-03-12 14:13 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2015-03-12 14:07 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Christian Borntraeger

while porting commit 89a883530fe7 ("checkpatch: ## is not a valid
modifier") to QEMU, Peter Maydell noticed that the | at the end of
the list is not necessary.

Lets get rid of it in kernel checkpatch.pl

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..403266d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1550,7 +1550,7 @@ sub possible {
 			asm|__asm__|
 			do|
 			\#|
-			\#\#|
+			\#\#
 		)(?:\s|$)|
 		^(?:typedef|struct|enum)\b
 	    )}x;
-- 
2.3.0


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

* Re: [PATCH] checkpatch: remove unneeded or ("|")
  2015-03-12 14:07 [PATCH] checkpatch: remove unneeded or ("|") Christian Borntraeger
@ 2015-03-12 14:13 ` Joe Perches
  2015-03-12 14:56   ` Andy Whitcroft
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2015-03-12 14:13 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: Andy Whitcroft, linux-kernel

On Thu, 2015-03-12 at 15:07 +0100, Christian Borntraeger wrote:
> while porting commit 89a883530fe7 ("checkpatch: ## is not a valid
> modifier") to QEMU, Peter Maydell noticed that the | at the end of
> the list is not necessary.
> 
> Lets get rid of it in kernel checkpatch.pl

Andy?  Was that meant to allow nothing?

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -1550,7 +1550,7 @@ sub possible {
>  			asm|__asm__|
>  			do|
>  			\#|
> -			\#\#|
> +			\#\#
>  		)(?:\s|$)|
>  		^(?:typedef|struct|enum)\b
>  	    )}x;




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

* Re: [PATCH] checkpatch: remove unneeded or ("|")
  2015-03-12 14:13 ` Joe Perches
@ 2015-03-12 14:56   ` Andy Whitcroft
  2015-03-24 11:54     ` Christian Borntraeger
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Whitcroft @ 2015-03-12 14:56 UTC (permalink / raw)
  To: Joe Perches; +Cc: Christian Borntraeger, linux-kernel

On Thu, Mar 12, 2015 at 07:13:35AM -0700, Joe Perches wrote:
> On Thu, 2015-03-12 at 15:07 +0100, Christian Borntraeger wrote:
> > while porting commit 89a883530fe7 ("checkpatch: ## is not a valid
> > modifier") to QEMU, Peter Maydell noticed that the | at the end of
> > the list is not necessary.
> > 
> > Lets get rid of it in kernel checkpatch.pl
> 
> Andy?  Was that meant to allow nothing?
> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -1550,7 +1550,7 @@ sub possible {
> >  			asm|__asm__|
> >  			do|
> >  			\#|
> > -			\#\#|
> > +			\#\#
> >  		)(?:\s|$)|
> >  		^(?:typedef|struct|enum)\b
> >  	    )}x;

Blimey you tax my memory indeed.

The two places it is used we are saying that the strings which match are
not modifiers.  So it seems sane that we would want to reject the empty
string in that case.  That said, it does not appear any of the callers
would call with a blank string.  I would suggest we had it like that as
a safety feature, _though_ if we had I would have expected it to have a
nice shiney comment to say just how smart we being using that trailing
or and so likely as not is is unintentional.

tl;dr I think it is safe to elide it with the current callers, it being
there seems safe, but if it stays damn it should have a comment to say
its a safety net and not just hide out.

-apw

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

* Re: [PATCH] checkpatch: remove unneeded or ("|")
  2015-03-12 14:56   ` Andy Whitcroft
@ 2015-03-24 11:54     ` Christian Borntraeger
  2015-03-24 14:11       ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2015-03-24 11:54 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel

Am 12.03.2015 um 15:56 schrieb Andy Whitcroft:
> On Thu, Mar 12, 2015 at 07:13:35AM -0700, Joe Perches wrote:
>> On Thu, 2015-03-12 at 15:07 +0100, Christian Borntraeger wrote:
>>> while porting commit 89a883530fe7 ("checkpatch: ## is not a valid
>>> modifier") to QEMU, Peter Maydell noticed that the | at the end of
>>> the list is not necessary.
>>>
>>> Lets get rid of it in kernel checkpatch.pl
>>
>> Andy?  Was that meant to allow nothing?
>>
>>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> []
>>> @@ -1550,7 +1550,7 @@ sub possible {
>>>  			asm|__asm__|
>>>  			do|
>>>  			\#|
>>> -			\#\#|
>>> +			\#\#
>>>  		)(?:\s|$)|
>>>  		^(?:typedef|struct|enum)\b
>>>  	    )}x;
> 
> Blimey you tax my memory indeed.
> 
> The two places it is used we are saying that the strings which match are
> not modifiers.  So it seems sane that we would want to reject the empty
> string in that case.  That said, it does not appear any of the callers
> would call with a blank string.  I would suggest we had it like that as
> a safety feature, _though_ if we had I would have expected it to have a
> nice shiney comment to say just how smart we being using that trailing
> or and so likely as not is is unintentional.
> 
> tl;dr I think it is safe to elide it with the current callers, it being
> there seems safe, but if it stays damn it should have a comment to say
> its a safety net and not just hide out.
> 
> -apw
> 

So how to proceed?
Take my patch, drop my patch or rework my patch?



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

* Re: [PATCH] checkpatch: remove unneeded or ("|")
  2015-03-24 11:54     ` Christian Borntraeger
@ 2015-03-24 14:11       ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2015-03-24 14:11 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: Andy Whitcroft, linux-kernel, Andrew Morton

On Tue, 2015-03-24 at 12:54 +0100, Christian Borntraeger wrote:
> Am 12.03.2015 um 15:56 schrieb Andy Whitcroft:
> > On Thu, Mar 12, 2015 at 07:13:35AM -0700, Joe Perches wrote:
> >> On Thu, 2015-03-12 at 15:07 +0100, Christian Borntraeger wrote:
> >>> while porting commit 89a883530fe7 ("checkpatch: ## is not a valid
> >>> modifier") to QEMU, Peter Maydell noticed that the | at the end of
> >>> the list is not necessary.
> >>>
> >>> Lets get rid of it in kernel checkpatch.pl
> >>
> >> Andy?  Was that meant to allow nothing?
> >>
> >>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> >> []
> >>> @@ -1550,7 +1550,7 @@ sub possible {
> >>>  			asm|__asm__|
> >>>  			do|
> >>>  			\#|
> >>> -			\#\#|
> >>> +			\#\#
> >>>  		)(?:\s|$)|
> >>>  		^(?:typedef|struct|enum)\b
> >>>  	    )}x;
> > 
> > Blimey you tax my memory indeed.
> > 
> > The two places it is used we are saying that the strings which match are
> > not modifiers.  So it seems sane that we would want to reject the empty
> > string in that case.  That said, it does not appear any of the callers
> > would call with a blank string.  I would suggest we had it like that as
> > a safety feature, _though_ if we had I would have expected it to have a
> > nice shiney comment to say just how smart we being using that trailing
> > or and so likely as not is is unintentional.
> > 
> > tl;dr I think it is safe to elide it with the current callers, it being
> > there seems safe, but if it stays damn it should have a comment to say
> > its a safety net and not just hide out.
> > 
> > -apw
> > 
> 
> So how to proceed?
> Take my patch, drop my patch or rework my patch?

If Andy acks it, I suggest sending it again
along with Andy's ack, to Andrew Morton (cc'd)


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

end of thread, other threads:[~2015-03-24 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12 14:07 [PATCH] checkpatch: remove unneeded or ("|") Christian Borntraeger
2015-03-12 14:13 ` Joe Perches
2015-03-12 14:56   ` Andy Whitcroft
2015-03-24 11:54     ` Christian Borntraeger
2015-03-24 14:11       ` Joe Perches

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.