[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250828122557.35025-1-liaoyuanhong@vivo.com>
Date: Thu, 28 Aug 2025 20:25:56 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>,
linux-pci@...r.kernel.org (open list:PCI SUBSYSTEM),
linux-kernel@...r.kernel.org (open list)
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH] PCI/VGA: Remove redundant ternary operators
For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.
Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
---
drivers/pci/vgaarb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 78748e8d2dba..abc84ef35397 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -1477,7 +1477,7 @@ static void vga_arbiter_notify_clients(void)
if (!vga_arbiter_used)
return;
- new_state = (vga_count > 1) ? false : true;
+ new_state = vga_count <= 1;
spin_lock_irqsave(&vga_lock, flags);
list_for_each_entry(vgadev, &vga_list, list) {
--
2.34.1
Powered by blists - more mailing lists