From: Colin King <colin.king@canonical.com>
To: Lijun Ou <oulijun@huawei.com>, Wei Hu <xavier.huwei@huawei.com>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2][next] RDMA/hns: fix inverted logic of readl read and shift
Date: Fri, 31 May 2019 10:21:01 +0100 [thread overview]
Message-ID: <20190531092101.28772-2-colin.king@canonical.com> (raw)
In-Reply-To: <20190531092101.28772-1-colin.king@canonical.com>
From: Colin Ian King <colin.king@canonical.com>
A previous change incorrectly changed the inverted logic and logically
negated the readl rather than the shifted readl result. Fix this by
adding in missing parentheses around the expression that needs to be
logically negated.
Addresses-Coverity: ("Logically dead code")
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c
index b3641aeff27a..a8e9329cbf4e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hem.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hem.c
@@ -378,7 +378,7 @@ static int hns_roce_set_hem(struct hns_roce_dev *hr_dev,
end = HW_SYNC_TIMEOUT_MSECS;
while (end > 0) {
- if (!readl(bt_cmd) >> BT_CMD_SYNC_SHIFT)
+ if (!(readl(bt_cmd) >> BT_CMD_SYNC_SHIFT))
break;
mdelay(HW_SYNC_SLEEP_TIME_INTERVAL);
--
2.20.1
next prev parent reply other threads:[~2019-05-31 9:21 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 ` Colin King [this message]
2019-06-07 17:57 ` [PATCH 2/2][next] RDMA/hns: fix inverted logic of readl read and shift 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
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=20190531092101.28772-2-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--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
all inboxes | Powered by JetHome®