From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636AbdJWWS4 (ORCPT ); Mon, 23 Oct 2017 18:18:56 -0400 Received: from smtprelay0231.hostedemail.com ([216.40.44.231]:59556 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751113AbdJWWSz (ORCPT ); Mon, 23 Oct 2017 18:18:55 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2692:2828:3138:3139:3140:3141:3142:3351:3622:3865:3867:3870:3871:3872:4321:5007:10004:10400:10848:11658:11914:12740:12895:13069:13311:13357:13439:13894:14181:14659:21080:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: bomb87_1340f9dfd664d X-Filterd-Recvd-Size: 1378 Message-ID: <1508797129.1955.5.camel@perches.com> Subject: Re: [PATCH] checkpatch: avoid false positive closing bracket with initializers From: Joe Perches To: Carlo Marcelo Arenas =?ISO-8859-1?Q?Bel=F3n?= , linux-kernel@vger.kernel.org Cc: apw@canonical.com Date: Mon, 23 Oct 2017 15:18:49 -0700 In-Reply-To: <20171023130605.65076-1-carenas@gmail.com> References: <20171023130605.65076-1-carenas@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-10-23 at 06:06 -0700, Carlo Marcelo Arenas Belón wrote: > when multiple closing brackets are being used for an universal zero > intializer as in (for example): > > struct timespec tv[10] = {{0}}; No objection. > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -4423,7 +4423,7 @@ sub process { > > # closing brace should have a space following it when it has anything > # on the line > - if ($line =~ /}(?!(?:,|;|\)))\S/) { > + if ($line =~ /}(?!(?:,|;|}|\)))\S/) { But perhaps this is easier to understand: if ($line =~ /}(?![,;}\)]\S/