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>] [day] [month] [year] [list]
Date:   Mon, 09 Aug 2021 13:25:06 -0700
From:   Joe Perches <joe@...ches.com>
To:     "Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>,
        Andy Whitcroft <apw@...onical.com>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: Re: Possible false positive from checkpatch.pl?

On Mon, 2021-08-09 at 15:15 -0500, Madhavan T. Venkataraman wrote:
> Hi,
> 
> I have defined the SYM_CODE_END() macro for ARM64 in arch/arm64/include/asm/linkage.h like this:
> 
> #define SYM_CODE_END(name)                              \
>         SYM_END(name, SYM_T_NONE)                       ;\
>         99:                                             ;\
>         .pushsection "sym_code_functions", "aw"         ;\
>         .quad   name                                    ;\
>         .quad   99b                                     ;\
>         .popsection
> 
> SYM_CODE_START() and SYM_CODE_END() macros are only used while defining assembly functions.
> They are never used in C code.
> 
> But checkpatch.pl is emitting the following messages (enclosed within ========). Looks like
> it is treating them like macros used in C code.
> 
> 
> =================
> ERROR: Macros with multiple statements should be enclosed in a do - while loop
> #21: FILE: arch/arm64/include/asm/linkage.h:68:
> +#define SYM_CODE_END(name)				\
> +	SYM_END(name, SYM_T_NONE)			;\
> +	99:						;\
> +	.pushsection "sym_code_functions", "aw"		;\
> +	.quad	name					;\
> +	.quad	99b					;\
> +	.popsection
> 
> ERROR: spaces required around that ':' (ctx:VxW)
> #23: FILE: arch/arm64/include/asm/linkage.h:70:
> +	99:						;\
>  	  ^
> 
> WARNING: labels should not be indented
> #23: FILE: arch/arm64/include/asm/linkage.h:70:
> +	99:						;\
> 
> total: 2 errors, 1 warnings, 124 lines checked
> 
> Wrote EXPERIMENTAL --fix correction(s) to '/tmp/x.EXPERIMENTAL-checkpatch-fixes'
> 
> Do _NOT_ trust the results written to this file.
> Do _NOT_ submit these changes without inspecting them for correctness.
> 
> This EXPERIMENTAL file is simply a convenience to help rewrite patches.
> No warranties, expressed or implied...
> 
> /tmp/x has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.
> ==================
> 
> How do I fix this? Can you please help?

Fix checkpatch?  If you _really_ want, you could change checkpatch
to skip .h file tests when $realfile =~ m@...m/@;

Otherwise, just be sensible and ignore checkpatch output that doesn't
make sense.  It's a stupid brainless script.  You are not.
> 
> Thanks in advance.
> 
> Madhavan T. Venkataraman


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ