diff mbox series

[4/4] checkpatch: remove ACCESS_ONCE() warning

Message ID 20171127103824.36526-5-mark.rutland@arm.com
State Accepted
Commit 8cb562b1d56fad42cbee44bdc9bc64cea41a0a8c
Headers show
Series Final ACCESS_ONCE() cleanups for v4.15 | expand

Commit Message

Mark Rutland Nov. 27, 2017, 10:38 a.m. UTC
Now that ACCESS_ONCE() has been excised from the kernel, any uses will
result in a build error, and we no longer need to whine about it in
checkpatch.

This patch removes the newly redundant warning.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 scripts/checkpatch.pl | 22 ----------------------
 1 file changed, 22 deletions(-)

-- 
2.11.0

Comments

Joe Perches Nov. 27, 2017, 10:50 a.m. UTC | #1
On Mon, 2017-11-27 at 10:38 +0000, Mark Rutland wrote:
> Now that ACCESS_ONCE() has been excised from the kernel, any uses will

> result in a build error, and we no longer need to whine about it in

> checkpatch.

> 

> This patch removes the newly redundant warning.


Acked-by: Joe Perches <joe@perches.com>


Normally, I send checkpatch patches via Andrew Morton,
but this could be merged this directly.

> Signed-off-by: Mark Rutland <mark.rutland@arm.com>

> Cc: Andy Whitcroft <apw@canonical.com>

> Cc: Ingo Molnar <mingo@redhat.com>

> Cc: Joe Perches <joe@perches.com>

> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> Cc: Peter Zijlstra <peterz@infradead.org>

> ---

>  scripts/checkpatch.pl | 22 ----------------------

>  1 file changed, 22 deletions(-)

> 

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl

> index 95cda3ecc66b..95c08493b78b 100755

> --- a/scripts/checkpatch.pl

> +++ b/scripts/checkpatch.pl

> @@ -6233,28 +6233,6 @@ sub process {

>  			}

>  		}

>  

> -# whine about ACCESS_ONCE

> -		if ($^V && $^V ge 5.10.0 &&

> -		    $line =~ /\bACCESS_ONCE\s*$balanced_parens\s*(=(?!=))?\s*($FuncArg)?/) {

> -			my $par = $1;

> -			my $eq = $2;

> -			my $fun = $3;

> -			$par =~ s/^\(\s*(.*)\s*\)$/$1/;

> -			if (defined($eq)) {

> -				if (WARN("PREFER_WRITE_ONCE",

> -					 "Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>\n" . $herecurr) &&

> -				    $fix) {

> -					$fixed[$fixlinenr] =~ s/\bACCESS_ONCE\s*\(\s*\Q$par\E\s*\)\s*$eq\s*\Q$fun\E/WRITE_ONCE($par, $fun)/;

> -				}

> -			} else {

> -				if (WARN("PREFER_READ_ONCE",

> -					 "Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)\n" . $herecurr) &&

> -				    $fix) {

> -					$fixed[$fixlinenr] =~ s/\bACCESS_ONCE\s*\(\s*\Q$par\E\s*\)/READ_ONCE($par)/;

> -				}

> -			}

> -		}

> -

>  # check for mutex_trylock_recursive usage

>  		if ($line =~ /mutex_trylock_recursive/) {

>  			ERROR("LOCKING",
Mark Rutland Nov. 27, 2017, 10:58 a.m. UTC | #2
On Mon, Nov 27, 2017 at 02:50:00AM -0800, Joe Perches wrote:
> On Mon, 2017-11-27 at 10:38 +0000, Mark Rutland wrote:

> > Now that ACCESS_ONCE() has been excised from the kernel, any uses will

> > result in a build error, and we no longer need to whine about it in

> > checkpatch.

> > 

> > This patch removes the newly redundant warning.

> 

> Acked-by: Joe Perches <joe@perches.com>

> 

> Normally, I send checkpatch patches via Andrew Morton,

> but this could be merged this directly.


Cheers Joe!

Mark.
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 95cda3ecc66b..95c08493b78b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6233,28 +6233,6 @@  sub process {
 			}
 		}
 
-# whine about ACCESS_ONCE
-		if ($^V && $^V ge 5.10.0 &&
-		    $line =~ /\bACCESS_ONCE\s*$balanced_parens\s*(=(?!=))?\s*($FuncArg)?/) {
-			my $par = $1;
-			my $eq = $2;
-			my $fun = $3;
-			$par =~ s/^\(\s*(.*)\s*\)$/$1/;
-			if (defined($eq)) {
-				if (WARN("PREFER_WRITE_ONCE",
-					 "Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>\n" . $herecurr) &&
-				    $fix) {
-					$fixed[$fixlinenr] =~ s/\bACCESS_ONCE\s*\(\s*\Q$par\E\s*\)\s*$eq\s*\Q$fun\E/WRITE_ONCE($par, $fun)/;
-				}
-			} else {
-				if (WARN("PREFER_READ_ONCE",
-					 "Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)\n" . $herecurr) &&
-				    $fix) {
-					$fixed[$fixlinenr] =~ s/\bACCESS_ONCE\s*\(\s*\Q$par\E\s*\)/READ_ONCE($par)/;
-				}
-			}
-		}
-
 # check for mutex_trylock_recursive usage
 		if ($line =~ /mutex_trylock_recursive/) {
 			ERROR("LOCKING",