]> www.infradead.org Git - users/hch/misc.git/commitdiff
usb: host: xhci-tegra: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Tue, 2 Sep 2025 13:27:19 +0000 (21:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Sep 2025 13:23:49 +0000 (15:23 +0200)
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>
Link: https://lore.kernel.org/r/20250902132720.85504-1-liaoyuanhong@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-tegra.c

index 0c7af44d4dae5066e66bd29c961510892b6e1301..460effa0e11edc0a92ae957b4de036f9dfca7d02 100644 (file)
@@ -1482,7 +1482,7 @@ static int tegra_xhci_id_notify(struct notifier_block *nb,
 
        tegra->otg_usb2_port = tegra_xusb_get_usb2_port(tegra, usbphy);
 
-       tegra->host_mode = (usbphy->last_event == USB_EVENT_ID) ? true : false;
+       tegra->host_mode = usbphy->last_event == USB_EVENT_ID;
 
        schedule_work(&tegra->id_work);