public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: don't complain about BIT macro in uapi
@ 2016-07-16 18:41 Tomas Winkler
  2016-07-16 21:36 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Winkler @ 2016-07-16 18:41 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Tomas Winkler

BIT macro cannot be exported to UAPI, so don't complain about it in
uapi headers.

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

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a0e511206f24..eee57484e42f 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] checkpatch: don't complain about BIT macro in uapi
  2016-07-16 18:41 [PATCH] checkpatch: don't complain about BIT macro in uapi Tomas Winkler
@ 2016-07-16 21:36 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2016-07-16 21:36 UTC (permalink / raw)
  To: Tomas Winkler, Andy Whitcroft; +Cc: linux-kernel, Andrew Morton

On Sat, 2016-07-16 at 21:41 +0300, Tomas Winkler wrote:
> BIT macro cannot be exported to UAPI, so don't complain about it in
> uapi headers.

Hi Tomas, this makes sense, but could you please
indent the second line to the open parenthesis?

Assuming this is done in V2:

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

> 
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
>  scripts/checkpatch.pl | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a0e511206f24..eee57484e42f 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",

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-16 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-16 18:41 [PATCH] checkpatch: don't complain about BIT macro in uapi Tomas Winkler
2016-07-16 21:36 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox