* [PATCH 0/3] phy: Remove redundant ternary operators
@ 2025-08-28 12:23 Liao Yuanhong
2025-08-28 12:23 ` [PATCH 1/3] phy: hisilicon: " Liao Yuanhong
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Liao Yuanhong @ 2025-08-28 12:23 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Yoshihiro Shimoda,
Geert Uytterhoeven, Magnus Damm, Heiko Stuebner,
open list:GENERIC PHY FRAMEWORK, open list,
open list:RENESAS USB PHY DRIVER,
moderated list:ARM/Rockchip SoC support,
open list:ARM/Rockchip SoC support
Cc: Liao Yuanhong
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.
Liao Yuanhong (3):
phy: hisilicon: Remove redundant ternary operators
phy: renesas: rcar-gen3-usb2: Remove redundant ternary operators
phy: rockchip: usbdp: Remove redundant ternary operators
drivers/phy/hisilicon/phy-histb-combphy.c | 2 +-
drivers/phy/renesas/phy-rcar-gen3-usb2.c | 2 +-
drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] phy: hisilicon: Remove redundant ternary operators
2025-08-28 12:23 [PATCH 0/3] phy: Remove redundant ternary operators Liao Yuanhong
@ 2025-08-28 12:23 ` Liao Yuanhong
2025-08-28 12:23 ` [PATCH 2/3] phy: renesas: rcar-gen3-usb2: " Liao Yuanhong
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Liao Yuanhong @ 2025-08-28 12:23 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I,
open list:GENERIC PHY FRAMEWORK, open list
Cc: Liao Yuanhong
Remove redundant ternary operators to clean up the code.
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
drivers/phy/hisilicon/phy-histb-combphy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/hisilicon/phy-histb-combphy.c b/drivers/phy/hisilicon/phy-histb-combphy.c
index 7436dcae3981..9dd0bd00b4e4 100644
--- a/drivers/phy/hisilicon/phy-histb-combphy.c
+++ b/drivers/phy/hisilicon/phy-histb-combphy.c
@@ -73,7 +73,7 @@ static void nano_register_write(struct histb_combphy_priv *priv,
static int is_mode_fixed(struct histb_combphy_mode *mode)
{
- return (mode->fixed != PHY_NONE) ? true : false;
+ return mode->fixed != PHY_NONE;
}
static int histb_combphy_set_mode(struct histb_combphy_priv *priv)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] phy: renesas: rcar-gen3-usb2: Remove redundant ternary operators
2025-08-28 12:23 [PATCH 0/3] phy: Remove redundant ternary operators Liao Yuanhong
2025-08-28 12:23 ` [PATCH 1/3] phy: hisilicon: " Liao Yuanhong
@ 2025-08-28 12:23 ` Liao Yuanhong
2025-08-28 12:31 ` Wolfram Sang
2025-08-28 12:23 ` [PATCH 3/3] phy: rockchip: usbdp: " Liao Yuanhong
2025-09-01 17:08 ` (subset) [PATCH 0/3] phy: " Vinod Koul
3 siblings, 1 reply; 6+ messages in thread
From: Liao Yuanhong @ 2025-08-28 12:23 UTC (permalink / raw)
To: Yoshihiro Shimoda, Vinod Koul, Kishon Vijay Abraham I,
Geert Uytterhoeven, Magnus Damm, open list:RENESAS USB PHY DRIVER,
open list:GENERIC PHY FRAMEWORK, open list
Cc: Liao Yuanhong
Remove redundant ternary operators to clean up the code.
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
drivers/phy/renesas/phy-rcar-gen3-usb2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index 7b4a6e8b7508..bab2d4dce5b3 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -306,7 +306,7 @@ static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
}
if (!ch->uses_otg_pins)
- return (ch->dr_mode == USB_DR_MODE_HOST) ? false : true;
+ return ch->dr_mode != USB_DR_MODE_HOST;
if (ch->phy_data->no_adp_ctrl)
return !!(readl(ch->base + USB2_LINECTRL1) & USB2_LINECTRL1_USB2_IDMON);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] phy: rockchip: usbdp: Remove redundant ternary operators
2025-08-28 12:23 [PATCH 0/3] phy: Remove redundant ternary operators Liao Yuanhong
2025-08-28 12:23 ` [PATCH 1/3] phy: hisilicon: " Liao Yuanhong
2025-08-28 12:23 ` [PATCH 2/3] phy: renesas: rcar-gen3-usb2: " Liao Yuanhong
@ 2025-08-28 12:23 ` Liao Yuanhong
2025-09-01 17:08 ` (subset) [PATCH 0/3] phy: " Vinod Koul
3 siblings, 0 replies; 6+ messages in thread
From: Liao Yuanhong @ 2025-08-28 12:23 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Heiko Stuebner,
open list:GENERIC PHY FRAMEWORK,
moderated list:ARM/Rockchip SoC support,
open list:ARM/Rockchip SoC support, open list
Cc: Liao Yuanhong
Remove redundant ternary operators to clean up the code.
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 010e9d2d6fac..fba35510d88c 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -666,7 +666,7 @@ static int rk_udphy_orien_sw_set(struct typec_switch_dev *sw,
goto unlock_ret;
}
- udphy->flip = (orien == TYPEC_ORIENTATION_REVERSE) ? true : false;
+ udphy->flip = orien == TYPEC_ORIENTATION_REVERSE;
rk_udphy_set_typec_default_mapping(udphy);
rk_udphy_usb_bvalid_enable(udphy, true);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] phy: renesas: rcar-gen3-usb2: Remove redundant ternary operators
2025-08-28 12:23 ` [PATCH 2/3] phy: renesas: rcar-gen3-usb2: " Liao Yuanhong
@ 2025-08-28 12:31 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2025-08-28 12:31 UTC (permalink / raw)
To: Liao Yuanhong
Cc: Yoshihiro Shimoda, Vinod Koul, Kishon Vijay Abraham I,
Geert Uytterhoeven, Magnus Damm, open list:RENESAS USB PHY DRIVER,
open list:GENERIC PHY FRAMEWORK, open list
On Thu, Aug 28, 2025 at 08:23:56PM +0800, Liao Yuanhong wrote:
> Remove redundant ternary operators to clean up the code.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH 0/3] phy: Remove redundant ternary operators
2025-08-28 12:23 [PATCH 0/3] phy: Remove redundant ternary operators Liao Yuanhong
` (2 preceding siblings ...)
2025-08-28 12:23 ` [PATCH 3/3] phy: rockchip: usbdp: " Liao Yuanhong
@ 2025-09-01 17:08 ` Vinod Koul
3 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2025-09-01 17:08 UTC (permalink / raw)
To: Kishon Vijay Abraham I, Yoshihiro Shimoda, Geert Uytterhoeven,
Magnus Damm, Heiko Stuebner, linux-phy, linux-kernel,
linux-renesas-soc, linux-arm-kernel, linux-rockchip,
Liao Yuanhong
On Thu, 28 Aug 2025 20:23:54 +0800, Liao Yuanhong wrote:
> 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.
>
> Liao Yuanhong (3):
> phy: hisilicon: Remove redundant ternary operators
> phy: renesas: rcar-gen3-usb2: Remove redundant ternary operators
> phy: rockchip: usbdp: Remove redundant ternary operators
>
> [...]
Applied, thanks!
[1/3] phy: hisilicon: Remove redundant ternary operators
commit: da938e39a81642748db3ec2385e8a53fe03d9bd1
[3/3] phy: rockchip: usbdp: Remove redundant ternary operators
commit: 0c5375b06060fa40a8f8ce2e926bde125fdf6c3b
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-01 17:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 12:23 [PATCH 0/3] phy: Remove redundant ternary operators Liao Yuanhong
2025-08-28 12:23 ` [PATCH 1/3] phy: hisilicon: " Liao Yuanhong
2025-08-28 12:23 ` [PATCH 2/3] phy: renesas: rcar-gen3-usb2: " Liao Yuanhong
2025-08-28 12:31 ` Wolfram Sang
2025-08-28 12:23 ` [PATCH 3/3] phy: rockchip: usbdp: " Liao Yuanhong
2025-09-01 17:08 ` (subset) [PATCH 0/3] phy: " Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).