From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: checkpatch: comparisons with a constant on the left
Date: Sun, 20 Oct 2019 16:30:17 +0900 [thread overview]
Message-ID: <20191020073017.GA247560@tigerII.localdomain> (raw)
In-Reply-To: <8720b5d432ca5ba5e128c241efee22674e012af8.camel@perches.com>
On (10/10/19 20:23), Joe Perches wrote:
> On Fri, 2019-10-11 at 10:52 +0900, Sergey Senozhatsky wrote:
> > Hi Joe,
>
> Hi Sergey.
Hi Joe,
For some reason your reply triggered gmail spam filter; took
me a while to notice and "recover" it from spam folder.
[..]
> > 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.
For example, DMA_BIT_MASK(xxx) can look like a function
call yet still be a compile time constant.
Another example could be ARRAY_SIZE(xxx), I guess.
[..]
> 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>
That's certainly right. LINUX_VERSION_CODE should not be in the
code, I agree. I was thinking more about 'const vs const' comparison
in general, less about particular LINUX_VERSION_CODE case.
-ss
prev parent reply other threads:[~2019-10-20 7:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 1:52 Sergey Senozhatsky
2019-10-11 3:23 ` Joe Perches
2019-10-20 7:30 ` Sergey Senozhatsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191020073017.GA247560@tigerII.localdomain \
--to=sergey.senozhatsky@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®