Messages in this thread Patch in this message | | | From | You Kangren <> | Subject | [PATCH] usb: typec: tcpm: Replace the ternary conditional operator with max() | Date | Mon, 26 Jun 2023 20:11:05 +0800 |
| |
Replace the ternary conditional operator with max() to make the code clean
Signed-off-by: You Kangren <youkangren@vivo.com> --- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 829d75ebab42..2a0b33bd2eb8 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -6353,7 +6353,7 @@ static int tcpm_psy_get_input_power_limit(struct tcpm_port *port, src_mv = pdo_fixed_voltage(pdo); src_ma = pdo_max_current(pdo); tmp = src_mv * src_ma; - max_src_uw = tmp > max_src_uw ? tmp : max_src_uw; + max_src_uw = max(tmp, max_src_uw); } } -- 2.39.0
| |