From: Jason Gunthorpe <jgg@ziepe.ca>
To: Colin King <colin.king@canonical.com>
Cc: Lijun Ou <oulijun@huawei.com>, Wei Hu <xavier.huwei@huawei.com>,
Doug Ledford <dledford@redhat.com>,
linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2][next] RDMA/hns: fix comparison of unsigned long variable 'end' with less than zero
Date: Wed, 24 Jul 2019 16:31:57 -0300 [thread overview]
Message-ID: <20190724193157.GA6620@ziepe.ca> (raw)
In-Reply-To: <20190531092101.28772-1-colin.king@canonical.com>
On Fri, May 31, 2019 at 10:21:00AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the comparison of end with less than zero is always false
> because end is an unsigned long. Also, replace checks of end with
> non-zero with end > 0 as it is possible that the #defined decrement
> may be changed in the future causing end to step over zero and go
> negative.
>
> The initialization of end with 0 is also redundant as this value is
> never read and is later set to HW_SYNC_TIMEOUT_MSECS, so fix this by
> initializing it with this value to begin with.
>
> Addresses-Coverity: ("Unsigned compared against 0")
> Fixes: 669cefb654cb ("RDMA/hns: Remove jiffies operation in disable interrupt context")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/hw/hns/hns_roce_hem.c | 4 ++--
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 12 ++++++------
> 2 files changed, 8 insertions(+), 8 deletions(-)
Applied to for-next, thanks
Jason
prev parent reply other threads:[~2019-07-24 20:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 9:21 [PATCH 1/2][next] RDMA/hns: fix comparison of unsigned long variable 'end' with less than zero Colin King
2019-05-31 9:21 ` [PATCH 2/2][next] RDMA/hns: fix inverted logic of readl read and shift Colin King
2019-06-07 17:57 ` Jason Gunthorpe
2019-06-07 17:57 ` [PATCH 1/2][next] RDMA/hns: fix comparison of unsigned long variable 'end' with less than zero Jason Gunthorpe
2019-07-09 10:58 ` oulijun
2019-07-24 19:31 ` Jason Gunthorpe [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=20190724193157.GA6620@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=colin.king@canonical.com \
--cc=dledford@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=oulijun@huawei.com \
--cc=xavier.huwei@huawei.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;
as well as URLs for NNTP newsgroup(s).