Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 926789b4 authored by Ivan Bornyakov's avatar Ivan Bornyakov Committed by Manohar Vavilapalli
Browse files

nvme: host: core: fix precedence of ternary operator



commit e9a9853c upstream.

Ternary operator have lower precedence then bitwise or, so 'cdw10' was
calculated wrong.

Signed-off-by: default avatarIvan Bornyakov <brnkv.i1@gmail.com>
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I149fe6f1c595335542950f8e71dd2c8fe3bf1e41
Git-commit: b6cdbf0f
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarManohar Vavilapalli <mvavilap@codeaurora.org>
parent 497e1f66
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1331,7 +1331,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);
}

@@ -1343,7 +1343,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);
}