Re: [PATCH] MAINTAINERS: Fix parsing usbhid from scripts/get_maintainer.pl

From: Joe Perches
Date: Thu Jun 16 2022 - 22:37:37 EST


On Thu, 2022-06-16 at 13:33 -0500, Mario Limonciello wrote:
> Recently trying to send a patch, I found that `./scripts/get_maintainer.pl`
> didn't want to parse the usbhid section because of too long of a line
> leading to a missing parenthesis. To fix this, change () to [] so it can
> parse even the long line.

It'd almost certainly better to change get_maintainer as there are many
possible entries like this.

Perhaps:
---
scripts/get_maintainer.pl | 3 +++
1 file changed, 3 insertions(+)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index ab123b498fd9b..2a8ee64cd7208 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -1256,6 +1256,9 @@ sub get_subsystem_name {
$subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
$subsystem =~ s/\s*$//;
$subsystem = $subsystem . "...";
+ my $openparens = () = $subsystem =~ /\(/g;
+ my $closeparens = () = $subsystem =~ /\)/g;
+ $subsystem .= ')' x ($openparens - $closeparens) if ($openparens > $closeparens);
}
return $subsystem;
}