* NVMe: Add persistent reservation ops
[not found] <20151103125815.GA5825@mwanda>
@ 2015-11-03 15:39 ` Keith Busch
2015-11-03 19:50 ` [patch] NVMe: Precedence error in nvme_pr_clear() Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2015-11-03 15:39 UTC (permalink / raw)
On Tue, Nov 03, 2015@03:58:15PM +0300, Dan Carpenter wrote:
>
> drivers/nvme/host/pci.c:2143 nvme_pr_clear()
> warn: suspicious bitop condition
>
> drivers/nvme/host/pci.c
> 2141 static int nvme_pr_clear(struct block_device *bdev, u64 key)
> 2142 {
> 2143 u32 cdw10 = 1 | key ? 1 << 3 : 0;
>
> Is this supposed to be?
>
> u32 cdw10 = 1 | (key ? 1 << 3 : 0);
>
> 2144 return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_register);
> 2145 }
Thanks for the catch. Must have pulled the patch from the wrong machine
when I added it to the persistent reservation series. Do you want to
send the fixing patch?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch] NVMe: Precedence error in nvme_pr_clear()
2015-11-03 15:39 ` NVMe: Add persistent reservation ops Keith Busch
@ 2015-11-03 19:50 ` Dan Carpenter
2015-11-03 19:58 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-11-03 19:50 UTC (permalink / raw)
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 at 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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [patch] NVMe: Precedence error in nvme_pr_clear()
2015-11-03 19:50 ` [patch] NVMe: Precedence error in nvme_pr_clear() Dan Carpenter
@ 2015-11-03 19:58 ` Jens Axboe
0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2015-11-03 19:58 UTC (permalink / raw)
On 11/03/2015 12:50 PM, Dan Carpenter wrote:
> 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 at oracle.com>
Thanks Dan, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-03 19:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20151103125815.GA5825@mwanda>
2015-11-03 15:39 ` NVMe: Add persistent reservation ops Keith Busch
2015-11-03 19:50 ` [patch] NVMe: Precedence error in nvme_pr_clear() Dan Carpenter
2015-11-03 19:58 ` Jens Axboe
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).