[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250902132613.84876-1-liaoyuanhong@vivo.com>
Date: Tue, 2 Sep 2025 21:26:08 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
Wayne Chang <waynec@...dia.com>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
linux-usb@...r.kernel.org (open list:USB SUBSYSTEM),
linux-tegra@...r.kernel.org (open list:TEGRA ARCHITECTURE SUPPORT),
linux-kernel@...r.kernel.org (open list)
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH] usb: gadget: tegra-xudc: 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/usb/gadget/udc/tegra-xudc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index 1d3085cc9d22..0c38fc37b6e6 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -812,8 +812,7 @@ static void tegra_xudc_update_data_role(struct tegra_xudc *xudc,
return;
}
- xudc->device_mode = (usbphy->last_event == USB_EVENT_VBUS) ? true :
- false;
+ xudc->device_mode = usbphy->last_event == USB_EVENT_VBUS;
phy_index = tegra_xudc_get_phy_index(xudc, usbphy);
dev_dbg(xudc->dev, "%s(): current phy index is %d\n", __func__,
--
2.34.1
Powered by blists - more mailing lists