NVMe: Precedence error in nvme_pr_clear()
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>
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 17524fd..9a12d5a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2136,7 +2136,7 @@
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);
}