From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbbCXLzI (ORCPT ); Tue, 24 Mar 2015 07:55:08 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:48740 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbbCXLzF (ORCPT ); Tue, 24 Mar 2015 07:55:05 -0400 Message-ID: <55115093.7040605@de.ibm.com> Date: Tue, 24 Mar 2015 12:54:59 +0100 From: Christian Borntraeger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Andy Whitcroft , Joe Perches CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch: remove unneeded or ("|") References: <1426169269-15332-1-git-send-email-borntraeger@de.ibm.com> <1426169615.32696.103.camel@perches.com> <20150312145631.GT6998@bark> In-Reply-To: <20150312145631.GT6998@bark> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15032411-0017-0000-0000-0000037C0014 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?