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

Commit 73fcf4e2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe
Browse files

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: 1d277a63: ('NVMe: Add persistent reservation ops')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent a6dd1020
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2136,7 +2136,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);
}