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


Groups > linux.kernel > #1444947 > unrolled thread

[PATCH v2] checkpatch: don't complain about BIT macro in uapi

Started byTomas Winkler <tomas.winkler@intel.com>
First post2016-07-17 00:20 +0200
Last post2016-07-20 00:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] checkpatch: don't complain about BIT macro in uapi Tomas Winkler <tomas.winkler@intel.com> - 2016-07-17 00:20 +0200
    Re: [PATCH v2] checkpatch: don't complain about BIT macro in uapi Joe Perches <joe@perches.com> - 2016-07-20 00:00 +0200

#1444947 — [PATCH v2] checkpatch: don't complain about BIT macro in uapi

FromTomas Winkler <tomas.winkler@intel.com>
Date2016-07-17 00:20 +0200
Subject[PATCH v2] checkpatch: don't complain about BIT macro in uapi
Message-ID<rVG6e-10k-15@gated-at.bofh.it>
BIT macro cannot be exported to UAPI, don't complain about it

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
V2: fix indentation
 scripts/checkpatch.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a0e511206f24..76d3fccb82f3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5733,8 +5733,9 @@ sub process {
 			}
 		}
 
-# check for #defines like: 1 << <digit> that could be BIT(digit)
-		if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
+# check for #defines like: 1 << <digit> that could be BIT(digit), it is not exported to uapi
+		if ($realfile !~ m@^include/uapi/@ &&
+		    $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",
-- 
2.5.5

[toc] | [next] | [standalone]


#1446744

FromJoe Perches <joe@perches.com>
Date2016-07-20 00:00 +0200
Message-ID<rWLdv-Zu-13@gated-at.bofh.it>
In reply to#1444947
On Sun, 2016-07-17 at 01:10 +0300, Tomas Winkler wrote:
> BIT macro cannot be exported to UAPI, don't complain about it
> 
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>

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


Andrew, can you please pick this up?
> ---
> V2: fix indentation
>  scripts/checkpatch.pl | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a0e511206f24..76d3fccb82f3 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5733,8 +5733,9 @@ sub process {
>  			}
>  		}
>  
> -# check for #defines like: 1 <<  that could be BIT(digit)
> -		if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
> +# check for #defines like: 1 <<  that could be BIT(digit), it is not exported to uapi
> +		if ($realfile !~ m@^include/uapi/@ &&
> +		    $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",

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web