Re: Re: [PATCH v3 1/2] checkpatch: support deprecated terms checking

From: Joe Perches
Date: Wed Jun 10 2020 - 04:45:46 EST


On Wed, 2020-06-10 at 10:01 +0200, SeongJae Park wrote:
> On Wed, 10 Jun 2020 00:13:42 -0700 Joe Perches <joe@xxxxxxxxxxx> wrote:
[]
> > This is a direct copy of the spelling dictionary
> > loading code, so maybe these could be consolidated.
>
> Agreed, how about below one?
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 524df88f9364..226f24e1f1f3 100755
[]
> +sub read_word_corrections {
> + my ($file) = @_;
> + my $suspects;
> + my %fixes;

Right.

But I think this should take a hash reference
as the second argument so the complete hash
isn't created and returned.

[]

> +# Load deprecated terms and build regular expression list.
> +my %deprecated_terms_fix = read_word_corrections($deprecated_terms_file);

So this might be something like:

my %deprecated_terms;
read_word_corrections($deprecated_terms_file, \%deprecated_terms);

etc...