From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] NVMe: Precedence error in nvme_pr_clear()
Date: Tue, 03 Nov 2015 19:50:49 +0000 [thread overview]
Message-ID: <20151103195049.GA17238@mwanda> (raw)
In-Reply-To: <20151103153958.GH13904@localhost.localdomain>
The original code is equivalent to:
u32 cdw10 = (1 | key) ? 1 << 3 : 0;
But we want:
u32 cdw10 = 1 | (key ? 1 << 3 : 0);
Fixes: 1d277a637a71: ('NVMe: Add persistent reservation ops')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 34fae28..8bcb772 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2140,7 +2140,7 @@ static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
static int nvme_pr_clear(struct block_device *bdev, u64 key)
{
- u32 cdw10 = 1 | key ? 1 << 3 : 0;
+ u32 cdw10 = 1 | (key ? 1 << 3 : 0);
return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_register);
}
next parent reply other threads:[~2015-11-03 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20151103153958.GH13904@localhost.localdomain>
2015-11-03 19:50 ` Dan Carpenter [this message]
2015-11-03 19:58 ` [patch] NVMe: Precedence error in nvme_pr_clear() Jens Axboe
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=20151103195049.GA17238@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.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).