lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 02 Oct 2020 12:39:11 -0700
From:   Joe Perches <joe@...ches.com>
To:     Łukasz Stelmach <l.stelmach@...sung.com>,
        Andy Whitcroft <apw@...onical.com>,
        linux-kernel@...r.kernel.org
Cc:     Bartłomiej Żolnierkiewicz 
        <b.zolnierkie@...sung.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH] checkpatch: Fix false positive on empty block comment
 lines

On Fri, 2020-10-02 at 21:15 +0200, Łukasz Stelmach wrote:
> To avoid false positives in presence of SPDX-License-Identifier in
> networking files it is required to increase the leeway for empty block
> comment lines by one line.

Thanks.

An example in the commit description would be nice.

The intent here is to avoid the below error so the
second line of a networking file can be an initial blank

/*

$ ./scripts/checkpatch.pl -f drivers/net/Space.c
WARNING: networking block comments don't use an empty /* line, use /* Comment...
#3: FILE: drivers/net/Space.c:3:
+/*
+ * INET		An implementation of the TCP/IP protocol suite for the LINUX

total: 0 errors, 1 warnings, 0 checks, 155 lines checked

> Signed-off-by: Łukasz Stelmach <l.stelmach@...sung.com>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a213cdb82ab0..60e10da4cccb 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3460,7 +3460,7 @@ sub process {
>  		if ($realfile =~ m@^(drivers/net/|net/)@ &&
>  		    $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
>  		    $rawline =~ /^\+[ \t]*\*/ &&
> -		    $realline > 2) {
> +		    $realline > 3) {
>  			WARN("NETWORKING_BLOCK_COMMENT_STYLE",
>  			     "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
>  		}

Maybe add a comment in the code too:

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

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a213cdb82ab0..632c543b108d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3457,10 +3457,11 @@ sub process {
 
 # Block comment styles
 # Networking with an initial /*
+# allow an initial blank /* at the top of the file with or without an SPDX line
 		if ($realfile =~ m@^(drivers/net/|net/)@ &&
 		    $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
 		    $rawline =~ /^\+[ \t]*\*/ &&
-		    $realline > 2) {
+		    $realline > 3) {
 			WARN("NETWORKING_BLOCK_COMMENT_STYLE",
 			     "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
 		}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ