mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
978628ec79
commit
e9a9853c23
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
|
||||||
enum pr_type type, bool abort)
|
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);
|
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)
|
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);
|
return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue