diff mbox series

[1/2] scripts: checkpatch: revert code modification

Message ID 20170601071823.457-1-petri.savolainen@linaro.org
State Accepted
Commit a48979af5b36c11fb5c7f8d2c6029c12bb191b51
Headers show
Series [1/2] scripts: checkpatch: revert code modification | expand

Commit Message

Petri Savolainen June 1, 2017, 7:18 a.m. UTC
Checkpatch code should not be modified directly. When the code
is updated to a next version, any local modifications would
be lost and needed to be done again.

Camelcase check is enabled again. Exceptions to camelcase are
allowed e.g. when calling an external library interface.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
 scripts/checkpatch.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.11.0

Comments

Bill Fischofer June 1, 2017, 11:53 a.m. UTC | #1
For this series:

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


On Thu, Jun 1, 2017 at 2:18 AM, Petri Savolainen
<petri.savolainen@linaro.org> wrote:
> Checkpatch code should not be modified directly. When the code

> is updated to a next version, any local modifications would

> be lost and needed to be done again.

>

> Camelcase check is enabled again. Exceptions to camelcase are

> allowed e.g. when calling an external library interface.

>

> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

> ---

>  scripts/checkpatch.pl | 6 +++---

>  1 file changed, 3 insertions(+), 3 deletions(-)

>

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

> index 1c27ac60..16316b92 100755

> --- a/scripts/checkpatch.pl

> +++ b/scripts/checkpatch.pl

> @@ -4273,7 +4273,7 @@ sub process {

>                                                         $camelcase_file_seeded = 1;

>                                                 }

>                                         }

> -                                       if (!defined $camelcase{$word} && 0) {

> +                                       if (!defined $camelcase{$word}) {

>                                                 $camelcase{$word} = 1;

>                                                 CHK("CAMELCASE",

>                                                     "Avoid CamelCase: <$word>\n" . $herecurr);

> @@ -4620,7 +4620,7 @@ sub process {

>

>  # no volatiles please

>                 my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};

> -               if ($line =~ /\bvolatile\b/ && 0 && $line !~ /$asm_volatile/) {

> +               if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {

>                         WARN("VOLATILE",

>                              "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);

>                 }

> @@ -5134,7 +5134,7 @@ sub process {

>                         if (defined $cond) {

>                                 substr($s, 0, length($cond), '');

>                         }

> -                       if ($s =~ /^\s*;/ && 0 &&

> +                       if ($s =~ /^\s*;/ &&

>                             $function_name ne 'uninitialized_var')

>                         {

>                                 WARN("AVOID_EXTERNS",

> --

> 2.11.0

>
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1c27ac60..16316b92 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4273,7 +4273,7 @@  sub process {
 							$camelcase_file_seeded = 1;
 						}
 					}
-					if (!defined $camelcase{$word} && 0) {
+					if (!defined $camelcase{$word}) {
 						$camelcase{$word} = 1;
 						CHK("CAMELCASE",
 						    "Avoid CamelCase: <$word>\n" . $herecurr);
@@ -4620,7 +4620,7 @@  sub process {
 
 # no volatiles please
 		my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
-		if ($line =~ /\bvolatile\b/ && 0 && $line !~ /$asm_volatile/) {
+		if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
 			WARN("VOLATILE",
 			     "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
 		}
@@ -5134,7 +5134,7 @@  sub process {
 			if (defined $cond) {
 				substr($s, 0, length($cond), '');
 			}
-			if ($s =~ /^\s*;/ && 0 &&
+			if ($s =~ /^\s*;/ &&
 			    $function_name ne 'uninitialized_var')
 			{
 				WARN("AVOID_EXTERNS",