[PATCH] PCI/VGA: Remove redundant ternary operators

Liao Yuanhong posted 1 patch 1 month ago
drivers/pci/vgaarb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] PCI/VGA: Remove redundant ternary operators
Posted by Liao Yuanhong 1 month ago
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@vivo.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