summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host
diff options
context:
space:
mode:
authorIvan Bornyakov <brnkv.i1@gmail.com>2018-05-23 17:56:11 +0300
committerKeith Busch <keith.busch@intel.com>2018-05-23 09:11:37 -0600
commite9a9853c23c13a37546397b61b270999fd0fb759 (patch)
tree33668f06abdbcdbf6238017be6034d160aab3f71 /drivers/nvme/host
parent978628ec795b18179e74ef12cfcd35bae569d13e (diff)
downloadlinux-stable-e9a9853c23c13a37546397b61b270999fd0fb759.tar.gz
linux-stable-e9a9853c23c13a37546397b61b270999fd0fb759.tar.bz2
linux-stable-e9a9853c23c13a37546397b61b270999fd0fb759.zip
nvme: host: core: fix precedence of ternary operator
Ternary operator have lower precedence then bitwise or, so 'cdw10' was calculated wrong. Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r--drivers/nvme/host/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 5e1d6d69b307..dc8aa2c1c22a 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1578,7 +1578,7 @@ static int nvme_pr_reserve(struct block_device *bdev, u64 key,
static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
enum pr_type type, bool abort)
{
- u32 cdw10 = nvme_pr_type(type) << 8 | abort ? 2 : 1;
+ u32 cdw10 = nvme_pr_type(type) << 8 | (abort ? 2 : 1);
return nvme_pr_command(bdev, cdw10, old, new, nvme_cmd_resv_acquire);
}
@@ -1590,7 +1590,7 @@ static int nvme_pr_clear(struct block_device *bdev, u64 key)
static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type)
{
- u32 cdw10 = nvme_pr_type(type) << 8 | key ? 1 << 3 : 0;
+ u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0);
return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
}