diff options
| author | R Sundar <prosunofficial@gmail.com> | 2024-09-25 17:50:14 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-04 15:12:07 +0200 |
| commit | d7e75301b5d58f985a128e3875bd2ddf2bd3943b (patch) | |
| tree | 6373cbf7268292e00ec3c838121f27bf0c838a2f | |
| parent | usb: typec: ucsi: glink: use device_for_each_child_node_scoped() (diff) | |
| download | linux-d7e75301b5d58f985a128e3875bd2ddf2bd3943b.tar.gz linux-d7e75301b5d58f985a128e3875bd2ddf2bd3943b.zip | |
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>
| -rw-r--r-- | drivers/usb/typec/tcpm/tcpm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index b6486beda6ab..d6f2412381cf 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); } } |
