Commit e121a20b authored by Dan Carpenter's avatar Dan Carpenter Committed by Tim Gardner

nvme: precedence bug in nvme_pr_clear()

BugLink: http://bugs.launchpad.net/bugs/1531539

The "|" operator has higher precedence than "?:" so this didn't work as
intended.  I had previously fixed this bug, but it we copied the older
unfixed version when we moved the function between files.

Fixes: 1673f1f0 ('nvme: move block_device_operations and ns/ctrl freeing to common code')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
(cherry picked from commit 8c0b3915)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 4b6598a0
......@@ -671,7 +671,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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment