iommu/intel: Use logical OR operator for privilege mode check
Subsystems (2)
PATCH 1/1 iommu/intel: Use logical OR operator for privilege mode check
From: Li RongQing <[email protected]>
Replace bitwise OR (|) with logical OR (||) in the privilege mode validation check. While both operators produce the same result for boolean values (0 or 1), using logical OR is semantically correct and makes the intent clearer.
No functional change, but improves code readability.
Signed-off-by Li RongQing <[email protected]>
--- drivers/iommu/intel/prq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/prq.c +1 -1
@@ -223,7 +223,7 @@ static irqreturn_t prq_event_thread(int irq, void *d) goto prq_advance; } -if (unlikely (req->pm_req && (req->rd_req | req->wr_req))) { +if (unlikely (req->pm_req && (req->rd_req || req->wr_req))) {pr_err ("IOMMU: %s: Page request in Privilege Mode\n" , iommu->name); goto bad_req;
Signature · 1 line
2.9.4
Quoted 7 lines · lirongqing
From: Li RongQing<[email protected]>
Replace bitwise OR (|) with logical OR (||) in the privilege mode validation check. While both operators produce the same result for boolean values (0 or 1), using logical OR is semantically correct and makes the intent clearer.
Quoted 6 lines
No functional change, but improves code readability.
Signed-off-by Li RongQing<[email protected]>--- drivers/iommu/intel/prq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Queued for v7.3-rc1. Thanks a lot.