From d0a3c966bfdfdd9a30cd9f832db55b2d8d76b42f Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 9 Dec 2015 13:24:06 +0300 Subject: [PATCH] nvme: precedence bug in nvme_pr_clear() 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: 1673f1f08c88 ('nvme: move block_device_operations and ns/ctrl freeing to common code') Signed-off-by: Dan Carpenter Signed-off-by: Jens Axboe (cherry picked from commit 8c0b39155048d5a24f25c6c60aa83729927b04cd) Orabug: 25130845 Signed-off-by: Ashok Vairavan Reviewed-by: Martin K. Petersen --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c634f8d09211..1ac5f7a1409c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -631,7 +631,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); } -- 2.50.1