Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: tcpm: use max() to get higher value

Use max() for better readability and to fix cocci warnings.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202409231009.2efXAh9b-lkp@intel.com/
Signed-off-by: R Sundar <prosunofficial@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240925122014.552221-1-prosunofficial@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

R Sundar and committed by
Greg Kroah-Hartman
d7e75301 4904f9aa

+1 -1
+1 -1
drivers/usb/typec/tcpm/tcpm.c
··· 7367 7367 src_mv = pdo_fixed_voltage(pdo); 7368 7368 src_ma = pdo_max_current(pdo); 7369 7369 tmp = src_mv * src_ma; 7370 - max_src_uw = tmp > max_src_uw ? tmp : max_src_uw; 7370 + max_src_uw = max(tmp, max_src_uw); 7371 7371 } 7372 7372 } 7373 7373