Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1831685imm; Mon, 3 Sep 2018 10:33:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYoyyEG7smTYf3ETeO8LEifVsoQKld0aeGYul5ritpV16xvoVsUR/xB/DHIaH6oPsJXz6sN X-Received: by 2002:a63:352:: with SMTP id 79-v6mr27156458pgd.112.1535996034445; Mon, 03 Sep 2018 10:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535996034; cv=none; d=google.com; s=arc-20160816; b=lSHMMwx7r166vCByGWbH+noHgqP/cx0uzc6cZseVlDy/ig0j6yPffko0OyCPtUawBJ iw7bjK5+aQS4apXnvgYtBogR15ksM0dwB5n/UJHT1RHLCWhputpztjBBgj0H7Cpk8m/D r2Cj3evLQzwlxvjLA0LCmnPZJI18GC0tJLvIpbwvTB34odaUih1CB65g9a+u58eyCcpz 2yM7SQuSn1X/2isffnGEI0HAjx4I02V71YIdGE+cF/ZOq2x8Ak2erbSW0NcNdgU6vIfJ 29Qr5hsdL0a+BvHUwQkn10mqdt1VI6xJbuuQc8niwimvWkLhbWob/9UbjICuNI9MaiVM /vgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8zi+nm7qJek0gKV/KVAy8XkYrGxSIWWoVPn8PuHTkMA=; b=rVKSZLHLLI7XcSZJnRrwjJTo95fLnp4tNbTPeEimF93z8s29Bd0gH82SNOem2Fy7Zt BIWUNwGWRe2BQd4Vn2K8II9uBTiDLZ3CyEAmK52F2c5Rf+tu5Y6NgMJqzaDYb6pV81uE 8cQAC0RTYYFhRnLCnCOGgZzu5nBsGT1j0JeBdBTIV3UwkYNGDfqm9wlAyzAQR7OFRuM5 8O4+gbknP4GJ/mN77eT/DUTn3OIZF8cci/BHcdJt5wc8d4ec/1BFwPun95B/JeXz9sv1 LZKnWfrMOJDUjrQaIgtzZT6BVtYrfep3C9f21EE0HK8qG6ZaEcUs4AHKkmiQW5VC94iL 2ZMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc5-v6si18261403plb.278.2018.09.03.10.33.39; Mon, 03 Sep 2018 10:33:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731144AbeICVxT (ORCPT + 99 others); Mon, 3 Sep 2018 17:53:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47300 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728303AbeICVxT (ORCPT ); Mon, 3 Sep 2018 17:53:19 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2471DD18; Mon, 3 Sep 2018 17:32:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Hutchings , Jonathan Corbet , Nathan Chancellor Subject: [PATCH 4.18 002/123] scripts/kernel-doc: Escape all literal braces in regexes Date: Mon, 3 Sep 2018 18:55:46 +0200 Message-Id: <20180903165719.598713258@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165719.499675257@linuxfoundation.org> References: <20180903165719.499675257@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben Hutchings commit 673bb2dfc36488abfdbbfc2ce2631204eaf682f2 upstream. Commit 701b3a3c0ac4 ("PATCH scripts/kernel-doc") fixed the two instances of literal braces that Perl 5.28 warns about, but there are still more than it doesn't warn about. Escape all left braces that are treated as literal characters. Also escape literal right braces, for consistency and to avoid confusing bracket-matching in text editors. Signed-off-by: Ben Hutchings Signed-off-by: Jonathan Corbet Cc: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- scripts/kernel-doc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1062,7 +1062,7 @@ sub dump_struct($$) { my $x = shift; my $file = shift; - if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) { + if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}/) { my $decl_type = $1; $declaration_name = $2; my $members = $3; @@ -1148,20 +1148,20 @@ sub dump_struct($$) { } } } - $members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)}([^\{\}\;]*)\;/$newmember/; + $members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)\}([^\{\}\;]*)\;/$newmember/; } # Ignore other nested elements, like enums - $members =~ s/(\{[^\{\}]*})//g; + $members =~ s/(\{[^\{\}]*\})//g; create_parameterlist($members, ';', $file, $declaration_name); check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual); # Adjust declaration for better display - $declaration =~ s/([{;])/$1\n/g; - $declaration =~ s/}\s+;/};/g; + $declaration =~ s/([\{;])/$1\n/g; + $declaration =~ s/\}\s+;/};/g; # Better handle inlined enums - do {} while ($declaration =~ s/(enum\s+{[^}]+),([^\n])/$1,\n$2/); + do {} while ($declaration =~ s/(enum\s+\{[^\}]+),([^\n])/$1,\n$2/); my @def_args = split /\n/, $declaration; my $level = 1; @@ -1171,12 +1171,12 @@ sub dump_struct($$) { $clause =~ s/\s+$//; $clause =~ s/\s+/ /; next if (!$clause); - $level-- if ($clause =~ m/(})/ && $level > 1); + $level-- if ($clause =~ m/(\})/ && $level > 1); if (!($clause =~ m/^\s*#/)) { $declaration .= "\t" x $level; } $declaration .= "\t" . $clause . "\n"; - $level++ if ($clause =~ m/(\{)/ && !($clause =~m/}/)); + $level++ if ($clause =~ m/(\{)/ && !($clause =~m/\}/)); } output_declaration($declaration_name, 'struct', @@ -1244,7 +1244,7 @@ sub dump_enum($$) { # strip #define macros inside enums $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; - if ($x =~ /enum\s+(\w+)\s*{(.*)}/) { + if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) { $declaration_name = $1; my $members = $2; my %_members; @@ -1785,7 +1785,7 @@ sub process_proto_type($$) { } while (1) { - if ( $x =~ /([^{};]*)([{};])(.*)/ ) { + if ( $x =~ /([^\{\};]*)([\{\};])(.*)/ ) { if( length $prototype ) { $prototype .= " " }