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

From: Joe Perches
Date: Tue Jul 19 2016 - 17:53:25 EST


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@xxxxxxxxx>

Acked-by: Joe Perches <joe@xxxxxxxxxxx>


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",