Skip to contentSkip to conversation

Recommend denylist/allowlist instead of blacklist/whitelist

PATCH In review SeongJae Park 8 participants 35 messages Jun 11, 2020 – Jul 28, 2020 Checkpatch

lore
Share & tools
lore
#0 lore raw

v4 cover Recommend denylist/allowlist instead of blacklist/whitelist

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

The patches are based on latest 'next/master'. You can get the complete git tree at:

https://github.com/sjp38/linux/tree/patches/checkpatch/deprecate_blacklist_whitelist_on_next_v4

Patch History
=============

Changes from v3
(https://lore.kernel.org/lkml/[email protected]/)
- Reuse the file read code for 'spelling.txt' (Joe Perches)
- Suggest 'denylist' rather than 'blocklist' (Jiri Slaby)
- Rebased on today's next/master

Changes from v2
(https://lore.kernel.org/lkml/[email protected]/)
- Implement and use deprecated terms check

Changes from v1
(https://lore.kernel.org/lkml/[email protected]/)
- Remove unnecessary commit message

SeongJae Park (2):
checkpatch: support deprecated terms checking scripts/deprecated_terms: Recommend denylist/allowlist instead of
blacklist/whitelist

 scripts/checkpatch.pl        | 60 +++++++++++++++++++++++++++---------
 scripts/deprecated_terms.txt |  7 +++++
 2 files changed, 52 insertions(+), 15 deletions(-)
 create mode 100644 scripts/deprecated_terms.txt
Signature · 1 line
2.17.1
#1 lore raw

PATCH v4 1/2 checkpatch: support deprecated terms checking

From: SeongJae Park <[email protected]>

Some terms could be deprecated for various reasons, but it is hard to update the entire old usages. That said, we could at least encourage new patches to use the suggested replacements. This commit adds check of deprecated terms in the 'checkpatch.pl' for that. The script will get deprecated terms and suggested replacements of those from 'scripts/deprecated_terms.txt' file and warn if the deprecated terms are used. The mechanism and the format of the file are almost the same as that of 'spelling.txt'. For the reason, this commit modularizes the read of the 'spelling.txt' and reuses.

---
 scripts/checkpatch.pl        | 60 +++++++++++++++++++++++++++---------
 scripts/deprecated_terms.txt |  5 +++
 2 files changed, 50 insertions(+), 15 deletions(-)
 create mode 100644 scripts/deprecated_terms.txt
scripts/checkpatch.pl +45 -15
index 524df88f9364..c672091932bb 100755
@@ -57,6 +57,7 @@ my $max_line_length = 100;
 my $ignore_perl_version = 0;
 my $minimum_perl_version = 5.10.0;
 my $min_conf_desc_length = 4;
+my $deprecated_terms_file = "$D/deprecated_terms.txt";
 my $spelling_file = "$D/spelling.txt";
 my $codespell = 0;
 my $codespellfile = "/usr/share/codespell/dictionary.txt";
@@ -692,29 +693,40 @@ our $allowed_asm_includes = qr{(?x:
 )};
 # memory.h: ARM has a custom one
 
-# Load common spelling mistakes and build regular expression list.
-my $misspellings;
-my %spelling_fix;
+sub read_word_corrections {
+	my ($file, $fixesRef) = @_;
+	my $suspects;
 
-if (open(my $spelling, '<', $spelling_file)) {
-	while (<$spelling>) {
-		my $line = $_;
+	if (open(my $corrections, '<', $file)) {
+		while (<$corrections>) {
+			my $line = $_;
 
-		$line =~ s/\s*\n?$//g;
-		$line =~ s/^\s*//g;
+			$line =~ s/\s*\n?$//g;
+			$line =~ s/^\s*//g;
 
-		next if ($line =~ m/^\s*#/);
-		next if ($line =~ m/^\s*$/);
+			next if ($line =~ m/^\s*#/);
+			next if ($line =~ m/^\s*$/);
 
-		my ($suspect, $fix) = split(/\|\|/, $line);
+			my ($suspect, $fix) = split(/\|\|/, $line);
 
-		$spelling_fix{$suspect} = $fix;
+			$fixesRef->{$suspect} = $fix;
+		}
+		close($corrections);
+	} else {
+		warn "No correction will be found - file '$file': $!\n";
 	}
-	close($spelling);
-} else {
-	warn "No typos will be found - file '$spelling_file': $!\n";
 }
 
+# Load deprecated terms and build regular expression list.
+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;
+
+# Load common spelling mistakes and build regular expression list.
+my $misspellings;
+my %spelling_fix;
+read_word_corrections($spelling_file, \%spelling_fix);
+
 if ($codespell) {
 	if (open(my $spelling, '<', $codespellfile)) {
 		while (<$spelling>) {
@@ -2957,6 +2969,24 @@ sub process {
 			}
 		}
 
+# Check for deprecated terms
+		if (defined($deprecated_terms) &&
+		    ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
+			while ($rawline =~ /(?:^|[^a-z@])($deprecated_terms)(?:\b|$|[^a-z@])/gi) {
+				my $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 = \&WARN;
+				$msg_level = \&CHK if ($file);
+				if (&{$msg_level}("DEPRECATED_TERM",
+						  "Use of '$deprecated_term' is deprecated, please '$suggested', instead.\n" . $herecurr) &&
+				    $fix) {
+					$fixed[$fixlinenr] =~ s/(^|[^A-Za-z@])($deprecated_term)($|[^A-Za-z@])/$1$suggested$3/;
+				}
+			}
+		}
+
 # Check for various typo / spelling mistakes
 		if (defined($misspellings) &&
 		    ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
scripts/deprecated_terms.txt new file +5 -0
new file mode 100644
index 000000000000..6faa06451c3d
@@ -0,0 +1,5 @@
+# License: GPLv2
+#
+# The format of each line is:
+# deprecated||suggested
+#
Signature · 1 line
2.17.1
#2 lore raw

Re: checkpatch: support deprecated terms checking

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

Best Regards
Michał Mirosław

maintainer
#3 lore raw

Re: checkpatch: support deprecated terms checking

Quoted 6 lines · Michał Mirosław

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?

Quoted 6 lines

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

I was never a big fan of this change.

Andrew, can you revert this please?

maintainer
#4 lore raw

Re: checkpatch: support deprecated terms checking

In reply to Michał Mirosław
Quoted 6 lines · Michał Mirosław

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?

Quoted 6 lines

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.

---
 scripts/checkpatch.pl | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)
scripts/checkpatch.pl +8 -13
index e9fde28eb0de..7ef1ba80cb20 100755
@@ -2970,21 +2970,16 @@ sub process {
 			}
 		}
 
-# Check for deprecated terms
-		if (defined($deprecated_terms) &&
+# Check for deprecated terms not used by a specification (not used on files)
+		if (!$file && defined($deprecated_terms) &&
 		    ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
 			while ($rawline =~ /(?:^|[^a-z@])($deprecated_terms)(?:\b|$|[^a-z@])/gi) {
-				my $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 = \&WARN;
-				$msg_level = \&CHK if ($file);
-				if (&{$msg_level}("DEPRECATED_TERM",
-						  "Use of '$deprecated_term' is deprecated, please '$suggested', instead.\n" . $herecurr) &&
-				    $fix) {
-					$fixed[$fixlinenr] =~ s/(^|[^A-Za-z@])($deprecated_term)($|[^A-Za-z@])/$1$suggested$3/;
-				}
+				my $deprecate = $1;
+				my $suggest = $deprecated_terms_fix{lc($deprecate)};
+				$suggest = ucfirst($suggest) if ($deprecate =~ /^[A-Z]/);
+				$suggest = uc($suggest) if ($deprecate =~ /^[A-Z]+$/);
+				CHK("DEPRECATED_TERM",
+				    "Use of '$deprecate' is controversial - if not required by specification, perhaps '$suggest' instead\n" . $herecurr);
 			}
 		}
 
#5 lore raw

Re: Re: checkpatch: support deprecated terms checking

Quoted 12 lines · On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches <[email protected]> wrote:
Quoted 11 lines · Michał Mirosław

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.

Quoted 5 lines
Quoted 1 line

[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?

Quoted 1 line

---

[...]

Thanks,
SeongJae Park

================================ >8 =========================================== From aeb852296bc40ca1de8a6a11f4d5368b02d2e417 Mon Sep 17 00:00:00 2001
From: SeongJae Park <[email protected]>
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.

---
 scripts/checkpatch.pl        | 2 +-
 scripts/deprecated_terms.txt | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
scripts/checkpatch.pl +1 -1
index e9fde28eb0de..77f5f777b053 100755
@@ -2981,7 +2981,7 @@ sub process {
 				my $msg_level = \&WARN;
 				$msg_level = \&CHK 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/;
 				}
scripts/deprecated_terms.txt +4 -2
index 1be27a24187b..d92b9c896fce 100644
@@ -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)
Signature · 1 line
2.17.1
maintainer
#6 lore raw

Re: Re: checkpatch: support deprecated terms checking

Quoted 16 lines · SeongJae Park
Quoted 14 lines · On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches <[email protected]> wrote:
Quoted 12 lines · Michał Mirosław

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

Quoted 8 lines
Quoted 3 lines

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.

scripts/deprecated_terms.txt

Quoted 1 line
scripts/deprecated_terms.txt +0 -0

[]

scripts/deprecated_terms.txt line 6

Quoted 5 lines
scripts/deprecated_terms.txt +1 -0
@@ -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.

Quoted 8 lines
scripts/deprecated_terms.txt +3 -2
+#
+# 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)
#7 lore raw

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

Quoted 26 lines · On Sat, 25 Jul 2020 21:27:07 -0700 Joe Perches <[email protected]> wrote:
Quoted 16 lines · SeongJae Park
Quoted 14 lines · On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches <[email protected]> wrote:
Quoted 12 lines · Michał Mirosław

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

Quoted 8 lines
Quoted 3 lines

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?

Quoted 5 lines

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.

Quoted 10 lines

scripts/deprecated_terms.txt

Quoted 2 lines
scripts/deprecated_terms.txt +0 -0

[]

scripts/deprecated_terms.txt line 6

Quoted 5 lines
scripts/deprecated_terms.txt +1 -0
@@ -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

Quoted 10 lines
Quoted 9 lines
scripts/deprecated_terms.txt +3 -2
+#
+# 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)
maintainer
#8 lore raw

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

Quoted 48 lines · SeongJae Park
Quoted 26 lines · On Sat, 25 Jul 2020 21:27:07 -0700 Joe Perches <[email protected]> wrote:
Quoted 16 lines · SeongJae Park
Quoted 14 lines · On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches <[email protected]> wrote:
Quoted 12 lines · Michał Mirosław

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

Quoted 8 lines
Quoted 3 lines

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?

Quoted 5 lines

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.

Quoted 9 lines

scripts/deprecated_terms.txt

Quoted 1 line
scripts/deprecated_terms.txt +0 -0

[]

scripts/deprecated_terms.txt line 6

Quoted 5 lines
scripts/deprecated_terms.txt +1 -0
@@ -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.

Quoted 5 lines

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.

#9 lore raw

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

Quoted 49 lines · On Sun, 26 Jul 2020 00:29:05 -0700 Joe Perches <[email protected]> wrote:
Quoted 48 lines · SeongJae Park
Quoted 26 lines · On Sat, 25 Jul 2020 21:27:07 -0700 Joe Perches <[email protected]> wrote:
Quoted 16 lines · SeongJae Park
Quoted 14 lines · On Sat, 25 Jul 2020 10:29:23 -0700 Joe Perches <[email protected]> wrote:
Quoted 12 lines · Michał Mirosław

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

Quoted 8 lines
Quoted 3 lines

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?

Quoted 5 lines

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.

Quoted 9 lines

scripts/deprecated_terms.txt

Quoted 1 line
scripts/deprecated_terms.txt +0 -0

[]

scripts/deprecated_terms.txt line 6

Quoted 5 lines
scripts/deprecated_terms.txt +1 -0
@@ -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.

Quoted 8 lines
Quoted 5 lines

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 <[email protected]>
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.

---
 scripts/checkpatch.pl        | 6 +++++-
 scripts/deprecated_terms.txt | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
scripts/checkpatch.pl +5 -1
index e9fde28eb0de..227e088bfe56 100755
@@ -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;
+
 				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 = \&WARN;
 				$msg_level = \&CHK 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/;
 				}
scripts/deprecated_terms.txt +4 -2
index 1be27a24187b..d92b9c896fce 100644
@@ -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)
Signature · 1 line
2.17.1
maintainer
#10 lore raw

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

scripts/checkpatch.pl

Quoted 1 line · SeongJae Park
scripts/checkpatch.pl +0 -0

[]

scripts/checkpatch.pl sub read_word_corrections { · line 724

Quoted 5 lines
scripts/checkpatch.pl +1 -0
@@ -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.

scripts/checkpatch.pl sub process { · line 2979

Quoted 5 lines
scripts/checkpatch.pl +1 -0
@@ -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

scripts/checkpatch.pl sub process { · line 2981

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+				$deprecated_terms_reported{$deprecated_term} = 1;
+

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

scripts/checkpatch.pl sub process { · line 2990

Quoted 10 lines
scripts/checkpatch.pl +1 -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 = \&WARN;
 				$msg_level = \&CHK 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.

#11 lore raw

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

Quoted 11 lines · On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches <[email protected]> wrote:

scripts/checkpatch.pl

Quoted 1 line · SeongJae Park
scripts/checkpatch.pl +0 -0

[]

scripts/checkpatch.pl sub read_word_corrections { · line 724

Quoted 5 lines
scripts/checkpatch.pl +1 -0
@@ -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.

Quoted 7 lines

scripts/checkpatch.pl sub process { · line 2979

Quoted 5 lines
scripts/checkpatch.pl +1 -0
@@ -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!

Quoted 5 lines

scripts/checkpatch.pl sub process { · line 2981

Quoted 3 lines
scripts/checkpatch.pl +2 -0
+				$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?

Quoted 13 lines

scripts/checkpatch.pl sub process { · line 2990

Quoted 11 lines
scripts/checkpatch.pl +1 -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 = \&WARN;
 				$msg_level = \&CHK 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.

Quoted 3 lines

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

maintainer
#12 lore raw

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

Quoted 1 line · SeongJae Park

On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches <[email protected]> wrote:

[]

Quoted 5 lines
Quoted 2 lines

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.

Quoted 2 lines

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.

#13 lore raw

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

Quoted 18 lines · On Sun, 26 Jul 2020 09:42:06 -0700 Joe Perches <[email protected]> wrote:
Quoted 1 line · SeongJae Park

On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches <[email protected]> wrote:

[]

Quoted 5 lines
Quoted 2 lines

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.

Quoted 2 lines

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

Quoted 8 lines

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 <[email protected]>
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.

---
 scripts/checkpatch.pl        | 6 +++++-
 scripts/deprecated_terms.txt | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
scripts/checkpatch.pl +5 -1
index e9fde28eb0de..abed47647fb0 100755
@@ -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 = \&WARN;
 				$msg_level = \&CHK 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/;
 				}
scripts/deprecated_terms.txt +4 -2
index 1be27a24187b..d92b9c896fce 100644
@@ -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)
Signature · 1 line
2.17.1
#14 lore raw

Re: checkpatch: support deprecated terms checking

Quoted 43 lines · SeongJae Park
Quoted 18 lines · On Sun, 26 Jul 2020 09:42:06 -0700 Joe Perches <[email protected]> wrote:
Quoted 1 line · SeongJae Park

On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches <[email protected]> wrote:

[]

Quoted 5 lines
Quoted 2 lines

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.

Quoted 2 lines

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

Quoted 8 lines

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.

Quoted 6 lines

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

Hi,

Maybe you could split the meaning of --subjective and --strict, and enable those checks only for --subjective? The test is really hard to do
right: you would have to consider the context and not only mere occurrence of a word (heh, I even wrote 'blacklisted' here, since it really is about a night/danger analogy and not political/ethical one).

Best Regards,
Michał Mirosław

#15 lore raw

Re: checkpatch: support deprecated terms checking

Quoted 51 lines · On Sun, 26 Jul 2020 22:33:28 +0200 "Michał Mirosław" <[email protected]>…
Quoted 43 lines · SeongJae Park
Quoted 18 lines · On Sun, 26 Jul 2020 09:42:06 -0700 Joe Perches <[email protected]> wrote:
Quoted 1 line · SeongJae Park

On Sun, 26 Jul 2020 07:50:54 -0700 Joe Perches <[email protected]> wrote:

[]

Quoted 5 lines
Quoted 2 lines

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.

Quoted 2 lines

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

Quoted 8 lines

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.

Quoted 6 lines

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

Quoted 7 lines

Hi,

Maybe you could split the meaning of --subjective and --strict, and enable those checks only for --subjective? The test is really hard to do
right: you would have to consider the context and not only mere occurrence of a word (heh, I even wrote 'blacklisted' here, since it really is about a night/danger analogy and not political/ethical one).

I'm concerning if applying the switch and making this patch non-default could reduce the check coverage. Moreover, IMHO, the deprecation rule of the terms that described in the 'coding-style.rst' is not so subjective but clear. Also, the checkpatch's warning/check message for those seems explicit enough to me.

And, the deprecated terms feature is not for this specific terms (master/slave/blacklist/whitelist) only but general deprecated terms. Maybe we could add one more rule in the 'deprecated_terms.txt' by adding a comment, say, "Please add only terms that deprecated with clear rules", for avoiding introduce of subjective deprecated terms in future, though.

Thanks,
SeongJae Park

Quoted 3 lines

Best Regards,
Michał Mirosław

#16 lore raw

Re: checkpatch: support deprecated terms checking

Quoted 2 lines · On Mon, 27 Jul 2020 08:54:41 +0200 SeongJae Park <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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

I don't think I really agree with the "new code only" guideline (where did this come from, anyway?). 10 years from now any remaining pre-2020 terms will look exceedingly archaic and will get converted at some point.

Wouldn't be longterm realistic to just bite the bullet now and add these conversions to the various todo lists?

maintainer
#17 lore raw

Re: checkpatch: support deprecated terms checking

Quoted 5 lines · Andrew Morton
Quoted 2 lines · On Mon, 27 Jul 2020 08:54:41 +0200 SeongJae Park <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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

Quoted 7 lines

I don't think I really agree with the "new code only" guideline (where did this come from, anyway?). 10 years from now any remaining pre-2020 terms will look exceedingly archaic and will get converted at some point.

Wouldn't be longterm realistic to just bite the bullet now and add these conversions to the various todo lists?

I don't think so.

There's no exclusion list for existing uses
written to external specification.

It's just emitting effectively noisy warnings
on things that should not be changed.

#18 lore raw

Re: checkpatch: support deprecated terms checking

Quoted 14 lines · On Mon, 27 Jul 2020 13:49:00 -0700 Joe Perches <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Quoted 2 lines · On Mon, 27 Jul 2020 08:54:41 +0200 SeongJae Park <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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

Quoted 7 lines

I don't think I really agree with the "new code only" guideline (where did this come from, anyway?). 10 years from now any remaining pre-2020 terms will look exceedingly archaic and will get converted at some point.

Wouldn't be longterm realistic to just bite the bullet now and add these conversions to the various todo lists?

Quoted 8 lines

I don't think so.

There's no exclusion list for existing uses
written to external specification.

It's just emitting effectively noisy warnings
on things that should not be changed.

Just noticed that this patchset and the followup[1] for sync with inclusive terms commit[2] are dropped from -mm tree. I admit it could generate some false positive warnings, though my followup patch[3] makes the message noisy but gives clear references.

I still believe it's better to provide the messages, but I also know people could think differently. After all, the biggest part of the initial goal of this patches is already made by the inclusive terms commit[2]. So, I would respect the decision.

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/process/coding-style.rst?id=a5f526ecb075a08c4a082355020166c7fe13ae27
[3] https://lore.kernel.org/lkml/[email protected]/

Thanks,
SeongJae Park

#19 lore raw

PATCH v4 2/2 scripts/deprecated_terms: Recommend denylist/allowlist instead of blacklist/whitelist

In reply to SeongJae Park

From: SeongJae Park <[email protected]>

This commit recommends the patches to replace 'blacklist' and 'whitelist' with the 'denylist' and 'allowlist', because the new suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

---
 scripts/deprecated_terms.txt | 2 ++
 1 file changed, 2 insertions(+)
scripts/deprecated_terms.txt +2 -0
index 6faa06451c3d..4512ef5d5ffa 100644
@@ -3,3 +3,5 @@
 # The format of each line is:
 # deprecated||suggested
 #
+blacklist||denylist
+whitelist||allowlist
Signature · 1 line
2.17.1
maintainer
#20 lore raw
In reply to SeongJae Park
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

While the checkpatch implementation is better,
I'm still very "meh" about the whole concept.

#21 lore raw
Quoted 11 lines · On Wed, 10 Jun 2020 23:35:24 -0700 Joe Perches <[email protected]> wrote:
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

While the checkpatch implementation is better,
I'm still very "meh" about the whole concept.

I can understand your concerns about politic things in the second patch. However, the concept of the 'deprecated terms' in the first patch is not political but applicable to the general cases. We already had the commits[1] for a similar case. So, could you ack for at least the first patch?

[1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs

Thanks,
SeongJae Park

#22 lore raw
Quoted 14 lines · SeongJae Park
Quoted 11 lines · On Wed, 10 Jun 2020 23:35:24 -0700 Joe Perches <[email protected]> wrote:
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

While the checkpatch implementation is better,
I'm still very "meh" about the whole concept.

Quoted 6 lines

I can understand your concerns about politic things in the second patch. However, the concept of the 'deprecated terms' in the first patch is not political but applicable to the general cases. We already had the commits[1] for a similar case. So, could you ack for at least the first patch?

[1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs

Fuck you! replaced by hug you! is a completely different story. The former is indeed offending to majority (despite it's quite common to tell someone "fuck you" in my subregion; OTOH hugging, no way -- I'm a straight non-communist). If it turns out that any word (e.g. blacklist) offends _majority_ (or at least a significant part of it) of some minority or culture, then sure, we should send it to /dev/null. But we should by no means listen to extreme individuals.

thanks,

Signature · 2 lines
js
suse labs
#23 lore raw
Quoted 22 lines · On Thu, 11 Jun 2020 10:16:09 +0200 Jiri Slaby <[email protected]> wrote:
Quoted 14 lines · SeongJae Park
Quoted 11 lines · On Wed, 10 Jun 2020 23:35:24 -0700 Joe Perches <[email protected]> wrote:
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

While the checkpatch implementation is better,
I'm still very "meh" about the whole concept.

Quoted 6 lines

I can understand your concerns about politic things in the second patch. However, the concept of the 'deprecated terms' in the first patch is not political but applicable to the general cases. We already had the commits[1] for a similar case. So, could you ack for at least the first patch?

[1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs

Quoted 7 lines

Fuck you! replaced by hug you! is a completely different story. The former is indeed offending to majority (despite it's quite common to tell someone "fuck you" in my subregion; OTOH hugging, no way -- I'm a straight non-communist). If it turns out that any word (e.g. blacklist) offends _majority_ (or at least a significant part of it) of some minority or culture, then sure, we should send it to /dev/null. But we should by no means listen to extreme individuals.

Thank you for the opinion. But, my point here is, deprecating some terms would occur in general as the f-word to hug replacement was, and the first patch is a simple technical preparation for such case. And, therefore, it would not need to be blocked due to the second patch.

For example, as it seems at least you and I agree on the f-word to hug replacement, we could add ``fuck||hug`` in the deprecated_terms.txt file to avoid future spread of the f-words.

Also, I personally don't think the second patch as a political extreme change but just a right thing to do. Nonetheless, I also understand people could think in different ways. Moreover, it is obviously non-technical thing which I am really bad at.

For the reason, I am CC-ing the code of conduct committees[1]. I would like to hear their opinions on this.

[1] https://www.kernel.org/code-of-conduct.html

Thanks,
SeongJae Park

Quoted 5 lines

thanks,

Signature · 2 lines
js
suse labs
#24 lore raw
Quoted 3 lines · SeongJae Park

For example, as it seems at least you and I agree on the f-word to hug replacement, we could add ``fuck||hug`` in the deprecated_terms.txt file to avoid future spread of the f-words.

You will likely get my ACK on that, if that helps.

thanks,

Signature · 2 lines
js
suse labs
maintainer
#25 lore raw
Quoted 6 lines · Jiri Slaby
Quoted 3 lines · SeongJae Park

For example, as it seems at least you and I agree on the f-word to hug replacement, we could add ``fuck||hug`` in the deprecated_terms.txt file to avoid future spread of the f-words.

You will likely get my ACK on that, if that helps.

But likely not mine.

$ git grep -i '\bfuck' | wc -l
15
#26 lore raw
Quoted 9 lines · On Thu, 11 Jun 2020 03:43:32 -0700 Joe Perches <[email protected]> wrote:
Quoted 6 lines · Jiri Slaby
Quoted 3 lines · SeongJae Park

For example, as it seems at least you and I agree on the f-word to hug replacement, we could add ``fuck||hug`` in the deprecated_terms.txt file to avoid future spread of the f-words.

You will likely get my ACK on that, if that helps.

But likely not mine.

It's ok, I will respect every opinion. But...

Quoted 3 lines
$ git grep -i '\bfuck' | wc -l
15

I'm not understanding what you're meaning with this. Could I ask your explanation, please?

Thanks,
SeongJae Park

maintainer
#27 lore raw
Quoted 6 lines · SeongJae Park
Quoted 5 lines · On Thu, 11 Jun 2020 03:43:32 -0700 Joe Perches <[email protected]> wrote:
Quoted 4 lines · Jiri Slaby
Quoted 3 lines · SeongJae Park

For example, as it seems at least you and I agree on the f-word to hug replacement, we could add ``fuck||hug`` in the deprecated_terms.txt file to avoid future spread of the f-words.

[]

Quoted 5 lines
Quoted 2 lines
$ git grep -i '\bfuck' | wc -l
15

I'm not understanding what you're meaning with this. Could I ask your explanation, please?

Just that there are 15 instances of that word in the kernel.

cheers, Joe

#28 lore raw
In reply to Jiri Slaby
Quoted 21 lines · Jiri Slaby
Quoted 13 lines · SeongJae Park
Quoted 11 lines · On Wed, 10 Jun 2020 23:35:24 -0700 Joe Perches <[email protected]> wrote:
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

While the checkpatch implementation is better,
I'm still very "meh" about the whole concept.

Quoted 6 lines

I can understand your concerns about politic things in the second patch. However, the concept of the 'deprecated terms' in the first patch is not political but applicable to the general cases. We already had the commits[1] for a similar case. So, could you ack for at least the first patch?

[1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs

Quoted 7 lines

Fuck you! replaced by hug you! is a completely different story. The former is indeed offending to majority (despite it's quite common to tell someone "fuck you" in my subregion; OTOH hugging, no way -- I'm a straight non-communist). If it turns out that any word (e.g. blacklist) offends _majority_ (or at least a significant part of it) of some minority or culture, then sure, we should send it to /dev/null. should by no means listen to extreme individuals.

I agree you have to draw the line somewhere, there will always be someone somewhere that's offended by something. But this seems like a pretty easy case.

It's not like blacklist / whitelist are even good to begin with, it's not obvious which is which, you have to learn that black is bad and white is good.

Blocklist (or denylist?) and allowlist are actually more descriptive and less likely to cause confusion.

cheers

#29 lore raw
Quoted 34 lines · Michael Ellerman
Quoted 21 lines · Jiri Slaby
Quoted 13 lines · SeongJae Park
Quoted 11 lines · On Wed, 10 Jun 2020 23:35:24 -0700 Joe Perches <[email protected]> wrote:
Quoted 7 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This patchset 1) adds support of deprecated terms in the 'checkpatch.pl' and 2) set the 'blacklist' and 'whitelist' as deprecated with replacement suggestion of 'denylist' and 'allowlist', because the suggestions are incontrovertible, doesn't make people hurt, and more self-explanatory.

While the checkpatch implementation is better,
I'm still very "meh" about the whole concept.

Quoted 6 lines

I can understand your concerns about politic things in the second patch. However, the concept of the 'deprecated terms' in the first patch is not political but applicable to the general cases. We already had the commits[1] for a similar case. So, could you ack for at least the first patch?

[1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs

Quoted 7 lines

Fuck you! replaced by hug you! is a completely different story. The former is indeed offending to majority (despite it's quite common to tell someone "fuck you" in my subregion; OTOH hugging, no way -- I'm a straight non-communist). If it turns out that any word (e.g. blacklist) offends _majority_ (or at least a significant part of it) of some minority or culture, then sure, we should send it to /dev/null. should by no means listen to extreme individuals.

I agree you have to draw the line somewhere, there will always be someone somewhere that's offended by something. But this seems like a pretty easy case.

Quoted 6 lines

It's not like blacklist / whitelist are even good to begin with, it's not obvious which is which, you have to learn that black is bad and white is good.

Blocklist (or denylist?) and allowlist are actually more descriptive and less likely to cause confusion.

You do not understand how word "blacklist" is used inside the kernel, do you? Do a quick grep.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#30 lore raw
Quoted 3 lines · Pavel Machek
Quoted 3 lines

I agree you have to draw the line somewhere, there will always be someone somewhere that's offended by something. But this seems like a pretty easy case.

Yes, hence I left up to the minority and/or the touched culture.

Quoted 9 lines
Quoted 6 lines

It's not like blacklist / whitelist are even good to begin with, it's not obvious which is which, you have to learn that black is bad and white is good.

Blocklist (or denylist?) and allowlist are actually more descriptive and less likely to cause confusion.

You do not understand how word "blacklist" is used inside the kernel, do you? Do a quick grep.

And now, do the same for "blocklist".

And is "denylist" a proper word? As grep gives zarro results...

It's not that easy to find alternatives. OTOH, admittedly, "blacklist" is used improperly in some contexts. Some synonyms fit better.

thanks,

Signature · 2 lines
js
suse labs
#31 lore raw
Quoted 12 lines · Jiri Slaby
Quoted 9 lines · Pavel Machek
Quoted 6 lines

It's not like blacklist / whitelist are even good to begin with, it's not obvious which is which, you have to learn that black is bad and white is good.

Blocklist (or denylist?) and allowlist are actually more descriptive and less likely to cause confusion.

You do not understand how word "blacklist" is used inside the kernel, do you? Do a quick grep.

Quoted 6 lines

And now, do the same for "blocklist".

And is "denylist" a proper word? As grep gives zarro results...

It's not that easy to find alternatives. OTOH, admittedly, "blacklist" is used improperly in some contexts. Some synonyms fit better.

Well, many of the uses is "list of hardware that needs particular workaround" or "list of hardware that is broken in some way"... Neither 'blocklist' nor 'denylist' fit that usage.

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#32 lore raw
Quoted 15 lines · On Mon, 15 Jun 2020 08:12:08 +0200 Pavel Machek <[email protected]> wrote:

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

Quoted 11 lines · Jiri Slaby
Quoted 9 lines · Pavel Machek
Quoted 6 lines

It's not like blacklist / whitelist are even good to begin with, it's not obvious which is which, you have to learn that black is bad and white is good.

Blocklist (or denylist?) and allowlist are actually more descriptive and less likely to cause confusion.

You do not understand how word "blacklist" is used inside the kernel, do you? Do a quick grep.

I of course did grep of the terms before making this patchset. There are so many uses of the term, and therefore I thought it would be very hard and painful to replace the whole words. Of course, I also found some miuse of the terms and therefore I thought automatic scripting for the replacement also wouldn't make sense.

That's why I made gives only warning to future patches. What this patch aims
to do is avoiding the further spread of the terms, and incremental replacements to better terms, rather than the one point buggy and risky replacement.

Quoted 11 lines
Quoted 7 lines

And now, do the same for "blocklist".

And is "denylist" a proper word? As grep gives zarro results...

It's not that easy to find alternatives. OTOH, admittedly, "blacklist" is used improperly in some contexts. Some synonyms fit better.

Well, many of the uses is "list of hardware that needs particular workaround" or "list of hardware that is broken in some way"... Neither 'blocklist' nor 'denylist' fit that usage.

Agreed, 'denylist' would also not fit in there. That said, this patchset will warn even such case so that people can think once again and find better term. So, I agree this patch is imperfect for many cases, but better than nothing.

Thanks,
SeongJae Park

maintainer
#33 lore raw
Quoted 1 line · SeongJae Park

So, I agree this patch is imperfect for many cases, but better than nothing.

Not necessarily.

Having people strain for unusual equivalents
to generally well known terms is not good.

blacklist/whitelist is well understood.

Would you do the same for red/black?

#34 lore raw
Quoted 7 lines · Joe Perches
Quoted 1 line · SeongJae Park

So, I agree this patch is imperfect for many cases, but better than nothing.

Not necessarily.

Having people strain for unusual equivalents
to generally well known terms is not good.

Exactly. Plus consistency is good, and having same structure named blacklist here and naughtyhardwarelist there does not really help.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html