Re: [PATCH] checkpatch.pl: Allow '+' in compatible strings

From: Joe Perches
Date: Tue Jul 14 2020 - 07:14:42 EST


On Tue, 2020-07-14 at 11:41 +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@xxxxxxxxxx>
>
> The current checks will interpret a '+' character as special because
> they use regular expression matching. Escape the '+' character if it
> appears in a compatible string.
>
> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>

Thanks

> ---
> scripts/checkpatch.pl | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4c820607540b..8104d0736e7f 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3145,6 +3145,7 @@ sub process {
> my $vp_file = $dt_path . "vendor-prefixes.yaml";
>
> foreach my $compat (@compats) {
> + $compat =~ s/\+/\\+/;

This changes the @compats array for each line
> my $compat2 = $compat;
> $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/;
> my $compat3 = $compat;