Re: Re: Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread SeongJae Park
On Sun, 26 Jul 2020 09:42:06 -0700 Joe Perches  wrote:

> On Sun, 2020-07-26 at 17:36 +0200, SeongJae Park wrote:
> > On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches  wrote:
> []
> > > I do not want to encourage relatively inexperienced people
> > > to run checkpatch and submit inappropriate patches.
> > 
> > Me, neither.  But, I think providing more warnings and references is better 
> > for
> > that.
> 
> Unfortunately, the inexperienced _do_ in fact run
> checkpatch on files and submit inappropriate patches.
> 
> It's generally a time sink for the experienced
> maintainers to reply.
> 
> > Simply limiting checks could allow people submitting inappropriate patches
> > intorducing new uses of deprecated terms.
> 
> Tradeoffs...
> 
> I expect that patches being reviewed by maintainers
> are preferred over files being inappropriately changed
> by the inexperienced.
> 
> Those inappropriate changes should not be encouraged
> by tools placed in the hands of the inexperienced.

Right, many things are tradeoff.  Seems we arrived in the point, though we
still have different opinions.  To summarize the pros and cons of my patch from
my perspective:

Pros 1: Handle future terms deprecated with different reasons and coverages.
Pros 2: Inappropriate patches are avoided if the submitters carefully read the
warning messages.
Cons: Careless people could still bother maintainers by not carefully reading
the message and sending inappropriate patches.

To me, the pros still seems larger than the cons.  I would like to also again
mention that the maintainer who first reported the problem, Michal, told it's
ok with the explicit messaging.  Nonethelss, this is just my opinion.

Attaching the patch addressing your comments for the previous version.  The
changes from the previous version are:

 - Make the name of reported terms not too verbose
 - Avoid unnecessary initialization of the reported terms hash
 - Warn multiple deprecated terms in same line


Thanks,
SeongJae Park


p.s I modified my mail formatter to skip adding 'Re:' in the subject.  I
thought it's usual behavior of the mailers, but seems it made you only
annoying, sorry.  I will not add more 'Re:' for you.


=== >8 
>From 169939e24ae98125efcf3af024e6e09cf5cd85f0 Mon Sep 17 00:00:00 2001
From: SeongJae Park 
Date: Sun, 26 Jul 2020 01:14:48 +0200
Subject: [PATCH v3] scripts/deprecatd_terms: provide references

Deprecation of terms could have special rules.  For example, 'slave' is
ok for existing usages.  Same to 'master', but it's also ok unless it's
used with 'slave'.  This commit provides the references for such rules.

Also, because the report became more verbose a little, this commit makes
the report to be made for only one instance of each deprecated term.

Signed-off-by: SeongJae Park 
---
 scripts/checkpatch.pl| 6 +-
 scripts/deprecated_terms.txt | 6 --
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e9fde28eb0de..abed47647fb0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -721,6 +721,7 @@ sub read_word_corrections {
 my %deprecated_terms_fix;
 read_word_corrections($deprecated_terms_file, \%deprecated_terms_fix);
 my $deprecated_terms = join("|", sort keys %deprecated_terms_fix) if keys 
%deprecated_terms_fix;
+my %deprecates_reported = map
 
 # Load common spelling mistakes and build regular expression list.
 my $misspellings;
@@ -2975,13 +2976,16 @@ sub process {
($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
while ($rawline =~ 
/(?:^|[^a-z@])($deprecated_terms)(?:\b|$|[^a-z@])/gi) {
my $deprecated_term = $1;
+   next if 
(exists($deprecates_reported{$deprecated_term}));
+   $deprecates_reported{$deprecated_term} = 1;
+
my $suggested = 
$deprecated_terms_fix{lc($deprecated_term)};
$suggested = ucfirst($suggested) if 
($deprecated_term=~ /^[A-Z]/);
$suggested = uc($suggested) if 
($deprecated_term =~ /^[A-Z]+$/);
my $msg_level = \
$msg_level = \ if ($file);
if (&{$msg_level}("DEPRECATED_TERM",
- "Use of '$deprecated_term' is 
deprecated, please '$suggested', instead.\n" . $herecurr) &&
+ "Use of '$deprecated_term' is 
controversial - if not required by specification, perhaps '$suggested' instead. 
 See: scripts/deprecated_terms.txt\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ 
s/(^|[^A-Za-z@])($deprecated_term)($|[^A-Za-z@])/$1$suggested$3/;
}
diff --git 

Re: Re: Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread Joe Perches
On Sun, 2020-07-26 at 17:36 +0200, SeongJae Park wrote:
> On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches  wrote:
[]
> > I do not want to encourage relatively inexperienced people
> > to run checkpatch and submit inappropriate patches.
> 
> Me, neither.  But, I think providing more warnings and references is better 
> for
> that.

Unfortunately, the inexperienced _do_ in fact run
checkpatch on files and submit inappropriate patches.

It's generally a time sink for the experienced
maintainers to reply.

> Simply limiting checks could allow people submitting inappropriate patches
> intorducing new uses of deprecated terms.

Tradeoffs...

I expect that patches being reviewed by maintainers
are preferred over files being inappropriately changed
by the inexperienced.

Those inappropriate changes should not be encouraged
by tools placed in the hands of the inexperienced.




Re: Re: Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread SeongJae Park
On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches  wrote:

> On Sun, 2020-07-26 at 09:45 +0200, SeongJae Park wrote:
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -721,6 +721,7 @@ sub read_word_corrections {
> >  my %deprecated_terms_fix;
> >  read_word_corrections($deprecated_terms_file, \%deprecated_terms_fix);
> >  my $deprecated_terms = join("|", sort keys %deprecated_terms_fix) if keys 
> > %deprecated_terms_fix;
> > +my %deprecated_terms_reported = map { $_ => 1 }
> 
> overly verbose naming and this doesn't need initialization here.
> 
> > @@ -2975,13 +2976,16 @@ sub process {
> > ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
> > while ($rawline =~ 
> > /(?:^|[^a-z@])($deprecated_terms)(?:\b|$|[^a-z@])/gi) { 
> > my $deprecated_term = $1;
> > +   last if 
> > (exists($deprecated_terms_reported{$deprecated_term}));
> 
> next if (...) to check if multiple terms exists on the same line

Agreed on these comments, thanks!

> 
> > +   $deprecated_terms_reported{$deprecated_term} = 
> > 1;
> > +
> 
> But this does need to be reset to empty when checking the next file

Hmm... I though you mean reporting same term multiple times too verbose... Did
I misunderstand your point?

> 
> > my $suggested = 
> > $deprecated_terms_fix{lc($deprecated_term)};
> > $suggested = ucfirst($suggested) if 
> > ($deprecated_term=~ /^[A-Z]/);
> > $suggested = uc($suggested) if 
> > ($deprecated_term =~ /^[A-Z]+$/);
> > my $msg_level = \
> > $msg_level = \ if ($file);
> > if (&{$msg_level}("DEPRECATED_TERM",
> > - "Use of '$deprecated_term' is 
> > deprecated, please '$suggested', instead.\n" . $herecurr) &&
> > + "Use of '$deprecated_term' is 
> > controversial - if not required by specification, perhaps '$suggested' 
> > instead.  See: scripts/deprecated_terms.txt\n" . $herecurr) &&
> > $fix) {
> > $fixed[$fixlinenr] =~ 
> > s/(^|[^A-Za-z@])($deprecated_term)($|[^A-Za-z@])/$1$suggested$3/;
> 
> I think it simpler to avoid emitting this on existing files.

Agreed, it's much simpler.  However, my concerns on excluding existing file
checks are:

1. Avoiding existing file checks will still not stop warning patches mentioning
existing deprecated terms.
2. If the term mistakenly comes in newly, it would be hard to check it later.
3. Some future deprecations of terms might be applied to existing uses, as
's/fuck/hug' did.

> 
> I do not want to encourage relatively inexperienced people
> to run checkpatch and submit inappropriate patches.

Me, neither.  But, I think providing more warnings and references is better for
that.  Experienced people would be able to easily ignore the false positives.
Simply limiting checks could allow people submitting inappropriate patches
intorducing new uses of deprecated terms.


Thanks,
SeongJae Park


Re: Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread Joe Perches
On Sun, 2020-07-26 at 09:45 +0200, SeongJae Park wrote:
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -721,6 +721,7 @@ sub read_word_corrections {
>  my %deprecated_terms_fix;
>  read_word_corrections($deprecated_terms_file, \%deprecated_terms_fix);
>  my $deprecated_terms = join("|", sort keys %deprecated_terms_fix) if keys 
> %deprecated_terms_fix;
> +my %deprecated_terms_reported = map { $_ => 1 }

overly verbose naming and this doesn't need initialization here.

> @@ -2975,13 +2976,16 @@ sub process {
>   ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
>   while ($rawline =~ 
> /(?:^|[^a-z@])($deprecated_terms)(?:\b|$|[^a-z@])/gi) { 
>   my $deprecated_term = $1;
> + last if 
> (exists($deprecated_terms_reported{$deprecated_term}));

next if (...) to check if multiple terms exists on the same line

> + $deprecated_terms_reported{$deprecated_term} = 
> 1;
> +

But this does need to be reset to empty when checking the next file

>   my $suggested = 
> $deprecated_terms_fix{lc($deprecated_term)};
>   $suggested = ucfirst($suggested) if 
> ($deprecated_term=~ /^[A-Z]/);
>   $suggested = uc($suggested) if 
> ($deprecated_term =~ /^[A-Z]+$/);
>   my $msg_level = \
>   $msg_level = \ if ($file);
>   if (&{$msg_level}("DEPRECATED_TERM",
> -   "Use of '$deprecated_term' is 
> deprecated, please '$suggested', instead.\n" . $herecurr) &&
> +   "Use of '$deprecated_term' is 
> controversial - if not required by specification, perhaps '$suggested' 
> instead.  See: scripts/deprecated_terms.txt\n" . $herecurr) &&
>   $fix) {
>   $fixed[$fixlinenr] =~ 
> s/(^|[^A-Za-z@])($deprecated_term)($|[^A-Za-z@])/$1$suggested$3/;

I think it simpler to avoid emitting this on existing files.

I do not want to encourage relatively inexperienced people
to run checkpatch and submit inappropriate patches.




Re: Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread SeongJae Park
On Sun, 26 Jul 2020 00:29:05 -0700 Joe Perches  wrote:

> On Sun, 2020-07-26 at 09:18 +0200, SeongJae Park wrote:
> > On Sat, 25 Jul 2020 21:27:07 -0700 Joe Perches  wrote:
> > 
> > > On Sun, 2020-07-26 at 01:35 +0200, SeongJae Park wrote:
> > > > On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches  wrote:
> > > > 
> > > > > On Sat, 2020-07-25 at 15:02 +0200, Michał Mirosław wrote:
> > > > > > Hello,
> > > > > > 
> > > > > > I see that this patch went into next and is already inciting people 
> > > > > > to
> > > > > > do wrong things [1]. Can you please fix it to require '--subjective'
> > > > > > switch or otherwise mark it clearly as suggestion-only?
> > > > > > 
> > > > > > The coding-style as in Linus' master says about *NEW* uses of the 
> > > > > > words
> > > > > > listed (those introductions I expect to be actually rare) and not 
> > > > > > about
> > > > > > existing use in the code or industry. Making a noise about all uses
> > > > > > found surely will generate a lot more irrelevant patches.
> > > > > > 
> > > > > > [1] https://www.spinics.net/lists/linux-tegra/msg51849.html
> > > > > 
> > > > > And if not reverted, perhaps do not check existing files
> > > > > at all but only check patches and change the message to
> > > > > show only suggestions not from a specification.
> > > > 
> > > > Agreed for this case.  However, excluding existing file check doesn't 
> > > > fully
> > > > avoid this problem.  Also, more terms having different deprecation 
> > > > rules might
> > > > be added in future.  How about allowing file check but show reference 
> > > > in the
> > > > suggestion message as below?
> > > 
> > > The general problem is that drivers/staging, net/ and drivers/net
> > > all have --strict on by default.
> > > 
> > > Emitting these deprecated terms messages with -f --file uses for
> > > files in those directories isn't a great idea.
> > 
> > Thank you for kindly explaining your concenrs in detail.  However, I think 
> > it's
> > ok to do this check even without '--strict' for files if we explicitly says
> > it's suggestion only, as Michal said.  My patch does so.
> > 
> > > > diff --git a/scripts/deprecated_terms.txt b/scripts/deprecated_terms.txt
> > > []
> > > > @@ -3,8 +3,10 @@
> > > >  # The format of each line is:
> > > >  # deprecated||suggested
> > > >  #
> > > > +# If special rules are applied on the terms, please comment those.
> > > 
> > > Disagree.  Comments about these existing uses aren't helpful.
> > 
> > Sorry, I don't understand your point here.  Why do you think it's not 
> > helpful?
> > If 'checkpatch' finds the deprecated terms, it will ask people to read this
> > file, which explains special rules for each of the deprecations if exists.  
> > The
> > rule is, in the case of 'slave', 'applies to new uses only'.  Therefore, 
> > people
> > could stop sending the noisy unnecessary patches to the maintainers.
> 
> Because it will describe this for _every_ instance
> of any deprecated word in the file.

Thank you for kindly explaining your concern.  I personally thought the verbose
warning is not a real problem.  Anyway, how about below patch, then?  It will
show only one warning or check for each of the terms.

= >8 ==

>From 6c606c62ea25933db8bb0afec083b5b4b8b3f11f Mon Sep 17 00:00:00 2001
From: SeongJae Park 
Date: Sun, 26 Jul 2020 01:14:48 +0200
Subject: [PATCH] scripts/deprecatd_terms: provide references

Deprecation of terms could have special rules.  For example, 'slave' is
ok for existing usages.  Same to 'master', but it's also ok unless it's
used with 'slave'.  This commit provides the references for such rules.

Also, because the report became more verbose a little, this commit makes
the report to be made for only one instance of each deprecated term.

Signed-off-by: SeongJae Park 
---
 scripts/checkpatch.pl| 6 +-
 scripts/deprecated_terms.txt | 6 --
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e9fde28eb0de..227e088bfe56 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -721,6 +721,7 @@ sub read_word_corrections {
 my %deprecated_terms_fix;
 read_word_corrections($deprecated_terms_file, \%deprecated_terms_fix);
 my $deprecated_terms = join("|", sort keys %deprecated_terms_fix) if keys 
%deprecated_terms_fix;
+my %deprecated_terms_reported = map { $_ => 1 }
 
 # Load common spelling mistakes and build regular expression list.
 my $misspellings;
@@ -2975,13 +2976,16 @@ sub process {
($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
while ($rawline =~ 
/(?:^|[^a-z@])($deprecated_terms)(?:\b|$|[^a-z@])/gi) {
my $deprecated_term = $1;
+   last if 
(exists($deprecated_terms_reported{$deprecated_term}));
+   $deprecated_terms_reported{$deprecated_term} = 
1;
+
 

Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread Joe Perches
On Sun, 2020-07-26 at 09:18 +0200, SeongJae Park wrote:
> On Sat, 25 Jul 2020 21:27:07 -0700 Joe Perches  wrote:
> 
> > On Sun, 2020-07-26 at 01:35 +0200, SeongJae Park wrote:
> > > On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches  wrote:
> > > 
> > > > On Sat, 2020-07-25 at 15:02 +0200, Michał Mirosław wrote:
> > > > > Hello,
> > > > > 
> > > > > I see that this patch went into next and is already inciting people to
> > > > > do wrong things [1]. Can you please fix it to require '--subjective'
> > > > > switch or otherwise mark it clearly as suggestion-only?
> > > > > 
> > > > > The coding-style as in Linus' master says about *NEW* uses of the 
> > > > > words
> > > > > listed (those introductions I expect to be actually rare) and not 
> > > > > about
> > > > > existing use in the code or industry. Making a noise about all uses
> > > > > found surely will generate a lot more irrelevant patches.
> > > > > 
> > > > > [1] https://www.spinics.net/lists/linux-tegra/msg51849.html
> > > > 
> > > > And if not reverted, perhaps do not check existing files
> > > > at all but only check patches and change the message to
> > > > show only suggestions not from a specification.
> > > 
> > > Agreed for this case.  However, excluding existing file check doesn't 
> > > fully
> > > avoid this problem.  Also, more terms having different deprecation rules 
> > > might
> > > be added in future.  How about allowing file check but show reference in 
> > > the
> > > suggestion message as below?
> > 
> > The general problem is that drivers/staging, net/ and drivers/net
> > all have --strict on by default.
> > 
> > Emitting these deprecated terms messages with -f --file uses for
> > files in those directories isn't a great idea.
> 
> Thank you for kindly explaining your concenrs in detail.  However, I think 
> it's
> ok to do this check even without '--strict' for files if we explicitly says
> it's suggestion only, as Michal said.  My patch does so.
> 
> > > diff --git a/scripts/deprecated_terms.txt b/scripts/deprecated_terms.txt
> > []
> > > @@ -3,8 +3,10 @@
> > >  # The format of each line is:
> > >  # deprecated||suggested
> > >  #
> > > +# If special rules are applied on the terms, please comment those.
> > 
> > Disagree.  Comments about these existing uses aren't helpful.
> 
> Sorry, I don't understand your point here.  Why do you think it's not helpful?
> If 'checkpatch' finds the deprecated terms, it will ask people to read this
> file, which explains special rules for each of the deprecations if exists.  
> The
> rule is, in the case of 'slave', 'applies to new uses only'.  Therefore, 
> people
> could stop sending the noisy unnecessary patches to the maintainers.

Because it will describe this for _every_ instance
of any deprecated word in the file.




Re: Re: Re: checkpatch: support deprecated terms checking

2020-07-26 Thread SeongJae Park
On Sat, 25 Jul 2020 21:27:07 -0700 Joe Perches  wrote:

> On Sun, 2020-07-26 at 01:35 +0200, SeongJae Park wrote:
> > On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches  wrote:
> > 
> > > On Sat, 2020-07-25 at 15:02 +0200, Michał Mirosław wrote:
> > > > Hello,
> > > > 
> > > > I see that this patch went into next and is already inciting people to
> > > > do wrong things [1]. Can you please fix it to require '--subjective'
> > > > switch or otherwise mark it clearly as suggestion-only?
> > > > 
> > > > The coding-style as in Linus' master says about *NEW* uses of the words
> > > > listed (those introductions I expect to be actually rare) and not about
> > > > existing use in the code or industry. Making a noise about all uses
> > > > found surely will generate a lot more irrelevant patches.
> > > > 
> > > > [1] https://www.spinics.net/lists/linux-tegra/msg51849.html
> > > 
> > > And if not reverted, perhaps do not check existing files
> > > at all but only check patches and change the message to
> > > show only suggestions not from a specification.
> > 
> > Agreed for this case.  However, excluding existing file check doesn't fully
> > avoid this problem.  Also, more terms having different deprecation rules 
> > might
> > be added in future.  How about allowing file check but show reference in the
> > suggestion message as below?
> 
> The general problem is that drivers/staging, net/ and drivers/net
> all have --strict on by default.
> 
> Emitting these deprecated terms messages with -f --file uses for
> files in those directories isn't a great idea.

Thank you for kindly explaining your concenrs in detail.  However, I think it's
ok to do this check even without '--strict' for files if we explicitly says
it's suggestion only, as Michal said.  My patch does so.

> 
> > diff --git a/scripts/deprecated_terms.txt b/scripts/deprecated_terms.txt
> []
> > @@ -3,8 +3,10 @@
> >  # The format of each line is:
> >  # deprecated||suggested
> >  #
> > +# If special rules are applied on the terms, please comment those.
> 
> Disagree.  Comments about these existing uses aren't helpful.

Sorry, I don't understand your point here.  Why do you think it's not helpful?
If 'checkpatch' finds the deprecated terms, it will ask people to read this
file, which explains special rules for each of the deprecations if exists.  The
rule is, in the case of 'slave', 'applies to new uses only'.  Therefore, people
could stop sending the noisy unnecessary patches to the maintainers.


Thanks,
SeongJae Park

> 
> > +#
> > +# Refer to "4) Naming" section of Documentation/process/coding-style.rst 
> > for
> > +# below three terms.
> >  blacklist||(denylist|blocklist)
> > -# For other alternatives of 'slave', Please refer to
> > -# Documentation/process/coding-style.rst
> >  slave||(secondary|target|...)
> >  whitelist||(allowlist|passlist)
> 


Re: Re: checkpatch: support deprecated terms checking

2020-07-25 Thread Joe Perches
On Sun, 2020-07-26 at 01:35 +0200, SeongJae Park wrote:
> On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches  wrote:
> 
> > On Sat, 2020-07-25 at 15:02 +0200, Michał Mirosław wrote:
> > > Hello,
> > > 
> > > I see that this patch went into next and is already inciting people to
> > > do wrong things [1]. Can you please fix it to require '--subjective'
> > > switch or otherwise mark it clearly as suggestion-only?
> > > 
> > > The coding-style as in Linus' master says about *NEW* uses of the words
> > > listed (those introductions I expect to be actually rare) and not about
> > > existing use in the code or industry. Making a noise about all uses
> > > found surely will generate a lot more irrelevant patches.
> > > 
> > > [1] https://www.spinics.net/lists/linux-tegra/msg51849.html
> > 
> > And if not reverted, perhaps do not check existing files
> > at all but only check patches and change the message to
> > show only suggestions not from a specification.
> 
> Agreed for this case.  However, excluding existing file check doesn't fully
> avoid this problem.  Also, more terms having different deprecation rules might
> be added in future.  How about allowing file check but show reference in the
> suggestion message as below?

The general problem is that drivers/staging, net/ and drivers/net
all have --strict on by default.

Emitting these deprecated terms messages with -f --file uses for
files in those directories isn't a great idea.

> diff --git a/scripts/deprecated_terms.txt b/scripts/deprecated_terms.txt
[]
> @@ -3,8 +3,10 @@
>  # The format of each line is:
>  # deprecated||suggested
>  #
> +# If special rules are applied on the terms, please comment those.

Disagree.  Comments about these existing uses aren't helpful.

> +#
> +# Refer to "4) Naming" section of Documentation/process/coding-style.rst for
> +# below three terms.
>  blacklist||(denylist|blocklist)
> -# For other alternatives of 'slave', Please refer to
> -# Documentation/process/coding-style.rst
>  slave||(secondary|target|...)
>  whitelist||(allowlist|passlist)




Re: Re: checkpatch: support deprecated terms checking

2020-07-25 Thread SeongJae Park
On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches  wrote:

> On Sat, 2020-07-25 at 15:02 +0200, Michał Mirosław wrote:
> > Hello,
> > 
> > I see that this patch went into next and is already inciting people to
> > do wrong things [1]. Can you please fix it to require '--subjective'
> > switch or otherwise mark it clearly as suggestion-only?
> > 
> > The coding-style as in Linus' master says about *NEW* uses of the words
> > listed (those introductions I expect to be actually rare) and not about
> > existing use in the code or industry. Making a noise about all uses
> > found surely will generate a lot more irrelevant patches.
> > 
> > [1] https://www.spinics.net/lists/linux-tegra/msg51849.html
> 
> And if not reverted, perhaps do not check existing files
> at all but only check patches and change the message to
> show only suggestions not from a specification.

Agreed for this case.  However, excluding existing file check doesn't fully
avoid this problem.  Also, more terms having different deprecation rules might
be added in future.  How about allowing file check but show reference in the
suggestion message as below?

> ---
[...]


Thanks,
SeongJae Park


 >8 ===
>From aeb852296bc40ca1de8a6a11f4d5368b02d2e417 Mon Sep 17 00:00:00 2001
From: SeongJae Park 
Date: Sun, 26 Jul 2020 01:14:48 +0200
Subject: [PATCH] scripts/deprecatd_terms: provide references

Deprecation of terms could have special rules.  For example, 'slave' is
ok for existing usages.  Same to 'master', but it's also ok unless it's
used with 'slave'.  This commit provides the references for such rules.

Signed-off-by: SeongJae Park 
---
 scripts/checkpatch.pl| 2 +-
 scripts/deprecated_terms.txt | 6 --
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e9fde28eb0de..77f5f777b053 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2981,7 +2981,7 @@ sub process {
my $msg_level = \
$msg_level = \ if ($file);
if (&{$msg_level}("DEPRECATED_TERM",
- "Use of '$deprecated_term' is 
deprecated, please '$suggested', instead.\n" . $herecurr) &&
+ "Use of '$deprecated_term' is 
controversial - if not required by specification, perhaps '$suggested' instead. 
 See: scripts/deprecated_terms.txt\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ 
s/(^|[^A-Za-z@])($deprecated_term)($|[^A-Za-z@])/$1$suggested$3/;
}
diff --git a/scripts/deprecated_terms.txt b/scripts/deprecated_terms.txt
index 1be27a24187b..d92b9c896fce 100644
--- a/scripts/deprecated_terms.txt
+++ b/scripts/deprecated_terms.txt
@@ -3,8 +3,10 @@
 # The format of each line is:
 # deprecated||suggested
 #
+# If special rules are applied on the terms, please comment those.
+#
+# Refer to "4) Naming" section of Documentation/process/coding-style.rst for
+# below three terms.
 blacklist||(denylist|blocklist)
-# For other alternatives of 'slave', Please refer to
-# Documentation/process/coding-style.rst
 slave||(secondary|target|...)
 whitelist||(allowlist|passlist)
-- 
2.17.1