lkml.org 
[lkml]   [2017]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] checkpatch: avoid false positive closing bracket with initializers
From
Date
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/

\
 
 \ /
  Last update: 2017-10-24 00:20    [W:2.354 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site