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, 03 Aug 2018 18:38:53 -0700
From:   Joe Perches <joe@...ches.com>
To:     Michal Zylowski <michal.zylowski@...el.com>, apw@...onical.com,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Check for space after "else" keyword

On Thu, 2018-08-02 at 23:20 +0200, Michal Zylowski wrote:
> Current checkpatch implementation permits notation like:
> } else{
> in kernel code.
> It looks like oversight and inconsistency in checkpatch rules (e.g.
> instruction like 'do' is tested).
> 
> Add regex for checking space after 'else' keyword and trigger error if
> space is not present.
> 
> Signed-off-by: Michal Zylowski <michal.zylowski@...el.com>

Acked-by: Joe Perches <joe@...ches.com

though it might be better if the do and else
was written on a single line like:

	$line =~ /\b(?:else|do)\{/

> ---
>  scripts/checkpatch.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index e16d671..2e3f41e 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -4479,6 +4479,7 @@ sub process {
>  
>  #need space before brace following if, while, etc
>  		if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) ||
> +		    $line =~ /else\{/ ||
>  		    $line =~ /do\{/) {
>  			if (ERROR("SPACING",
>  				  "space required before the open brace '{'\n" . $herecurr) &&

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ