All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/intel: Use logical OR operator for privilege mode check
@ 2026-06-05  0:40 lirongqing
  2026-07-27  2:46 ` Baolu Lu
  0 siblings, 1 reply; 2+ messages in thread
From: lirongqing @ 2026-06-05  0:40 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon,
	Robin Murphy, iommu, linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

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 <lirongqing@baidu.com>
---
 drivers/iommu/intel/prq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/prq.c b/drivers/iommu/intel/prq.c
index adf2bab..b89184a 100644
--- a/drivers/iommu/intel/prq.c
+++ b/drivers/iommu/intel/prq.c
@@ -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;
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iommu/intel: Use logical OR operator for privilege mode check
  2026-06-05  0:40 [PATCH] iommu/intel: Use logical OR operator for privilege mode check lirongqing
@ 2026-07-27  2:46 ` Baolu Lu
  0 siblings, 0 replies; 2+ messages in thread
From: Baolu Lu @ 2026-07-27  2:46 UTC (permalink / raw)
  To: lirongqing, David Woodhouse, Joerg Roedel, Will Deacon,
	Robin Murphy, iommu, linux-kernel

On 6/5/26 08:40, lirongqing wrote:
> From: Li RongQing<lirongqing@baidu.com>
> 
> 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<lirongqing@baidu.com>
> ---
>   drivers/iommu/intel/prq.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Queued for v7.3-rc1. Thanks a lot.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-27  2:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05  0:40 [PATCH] iommu/intel: Use logical OR operator for privilege mode check lirongqing
2026-07-27  2:46 ` Baolu Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.