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] [thread-next>] [day] [month] [year] [list]
Message-ID: <8720b5d432ca5ba5e128c241efee22674e012af8.camel@perches.com>
Date:   Thu, 10 Oct 2019 20:23:47 -0700
From:   Joe Perches <joe@...ches.com>
To:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: checkpatch: comparisons with a constant on the left

On Fri, 2019-10-11 at 10:52 +0900, Sergey Senozhatsky wrote:
> Hi Joe,

Hi Sergey.

> I noticed that this code
> 
> 	#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
> 
> triggers checkpatch's warning:
> 
> 	"WARNING: Comparisons should place the constant on
> 		  the right side of the test"
> 
> Both LINUX_VERSION_CODE and KERNEL_VERSION are constants, so
> I'm wondering if it's worth it to improve that check a tiny
> bit.

Probably not.

My preference is for people to ignore checkpatch
message bleats when they don't make overall sense.

checkpatch thinks anything that uses a form like
"name(<args...>)" is a function.

> I'm sure you'll have a better idea.

I suggest reversing the test if it really bothers you.

# if KERNEL_VERSION(4.18.0) < LINUX_VERSION_CODE

but then again just using LINUX_VERSION_CODE emits a
warning message, so it's better to remove whatever is
in the block anyway... <smile>

cheers, Joe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ