From: Dan Carpenter Date: Tue, 3 Nov 2015 19:50:49 +0000 (+0300) Subject: NVMe: Precedence error in nvme_pr_clear() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73fcf4e20ebd19468b3ad033be93582258435462;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: 1d277a637a71: ('NVMe: Add persistent reservation ops') Signed-off-by: Dan Carpenter Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 17524fd3e95f..9a12d5a32555 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -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); }