From: Dan Carpenter <dan.carpenter@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] XArray: Fix a math problem in xa_is_err()
Date: Wed, 16 Jan 2019 00:35:00 +0300 [thread overview]
Message-ID: <20190115213500.GJ4504@kadam> (raw)
In-Reply-To: <20190115210726.GC6310@bombadil.infradead.org>
On Tue, Jan 15, 2019 at 01:07:26PM -0800, Matthew Wilcox wrote:
> On Tue, Jan 15, 2019 at 10:52:41PM +0300, Dan Carpenter wrote:
> > @@ -177,7 +177,8 @@ static inline bool xa_is_internal(const void *entry)
> > static inline bool xa_is_err(const void *entry)
> > {
> > return unlikely(xa_is_internal(entry) &&
> > - (unsigned long)entry >= -((MAX_ERRNO << 2) + 2));
> > + (unsigned long)entry >=
> > + (((unsigned long)(-MAX_ERRNO << 2) + 2)));
> > }
>
> Ugh all the brackets, I'm not surprised I got it wrong. How about this
> instead; does it make your static checker happy?
>
I wasn't a super fan of that expression either... I think your code
will work, and if not then it's the checker which needs fixing. Thanks!
regards,
dan carpenter
prev parent reply other threads:[~2019-01-15 21:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 19:52 [PATCH] XArray: Fix a math problem in xa_is_err() Dan Carpenter
2019-01-15 21:07 ` Matthew Wilcox
2019-01-15 21:35 ` Dan Carpenter [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=20190115213500.GJ4504@kadam \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).