lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150312145631.GT6998@bark>
Date:	Thu, 12 Mar 2015 14:56:31 +0000
From:	Andy Whitcroft <apw@...onical.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Christian Borntraeger <borntraeger@...ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: remove unneeded or ("|")

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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ