Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1229553 > unrolled thread

[PATCH] checkpatch: avoid showing uint*_t warnings for tools/ files

Started byOctavian Purdila <octavian.purdila@intel.com>
First post2015-09-21 18:50 +0200
Last post2015-09-21 18:50 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] checkpatch: avoid showing uint*_t warnings for tools/ files Octavian Purdila <octavian.purdila@intel.com> - 2015-09-21 18:50 +0200
    [PATCH] checkpatch: avoid showing BIT_ULL warnings for tools/ files Octavian Purdila <octavian.purdila@intel.com> - 2015-09-21 18:50 +0200

#1229553 — [PATCH] checkpatch: avoid showing uint*_t warnings for tools/ files

FromOctavian Purdila <octavian.purdila@intel.com>
Date2015-09-21 18:50 +0200
Subject[PATCH] checkpatch: avoid showing uint*_t warnings for tools/ files
Message-ID<qbcrU-3RU-13@gated-at.bofh.it>
tools/ files are compiled in userspace so using types like uint8_t is
legitimate.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f2a1131..407eb6c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5221,8 +5221,9 @@ sub process {
 			      "Using weak declarations can have unintended link defects\n" . $herecurr);
 		}
 
-# check for c99 types like uint8_t used outside of uapi/
+# check for c99 types like uint8_t used outside of uapi/ and tools/
 		if ($realfile !~ m@\binclude/uapi/@ &&
+		    $realfile !~ m@\btools/@ &&
 		    $line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) {
 			my $type = $1;
 			if ($type =~ /\b($typeC99Typedefs)\b/) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1229562 — [PATCH] checkpatch: avoid showing BIT_ULL warnings for tools/ files

FromOctavian Purdila <octavian.purdila@intel.com>
Date2015-09-21 18:50 +0200
Subject[PATCH] checkpatch: avoid showing BIT_ULL warnings for tools/ files
Message-ID<qbcrV-3RU-39@gated-at.bofh.it>
In reply to#1229553
Directly using shift operations in userspace compiled code should not
trigger warnings as BIT_ULL macros are not available outside the
kernel.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 407eb6c..93557bf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5527,7 +5527,8 @@ sub process {
 		if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
 			my $ull = "";
 			$ull = "_ULL" if (defined($1) && $1 =~ /ll/i);
-			if (CHK("BIT_MACRO",
+			if ($realfile !~ m@\btools/@ &&
+			    CHK("BIT_MACRO",
 				"Prefer using the BIT$ull macro\n" . $herecurr) &&
 			    $fix) {
 				$fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web