* [patch] NVMe: Precedence error in nvme_pr_clear() [not found] <20151103153958.GH13904@localhost.localdomain> @ 2015-11-03 19:50 ` Dan Carpenter 2015-11-03 19:58 ` Jens Axboe 0 siblings, 1 reply; 2+ messages in thread From: Dan Carpenter @ 2015-11-03 19:50 UTC (permalink / raw) To: kernel-janitors 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); } ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [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; 2+ messages in thread From: Jens Axboe @ 2015-11-03 19:58 UTC (permalink / raw) To: kernel-janitors 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@oracle.com> Thanks Dan, applied. -- Jens Axboe ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-03 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20151103153958.GH13904@localhost.localdomain>
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).