From: R Sundar Date: Wed, 25 Sep 2024 12:20:14 +0000 (+0530) Subject: usb: typec: tcpm: use max() to get higher value X-Git-Tag: v6.13-rc1~31^2~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e75301b5d58f985a128e3875bd2ddf2bd3943b;p=thirdparty%2Fkernel%2Fstable.git usb: typec: tcpm: use max() to get higher value Use max() for better readability and to fix cocci warnings. Reported-by: kernel test robot Reported-by: Julia Lawall Closes: https://lore.kernel.org/r/202409231009.2efXAh9b-lkp@intel.com/ Signed-off-by: R Sundar Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20240925122014.552221-1-prosunofficial@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index b6486beda6ab0..d6f2412381cf9 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -7367,7 +7367,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); } }