usb: typec: tcpm: use max() to get higher value
Subsystems (3)
PATCH 1/1 usb: typec: tcpm: use max() to get higher value
Use max() for better readability and to fix cocci warnings.
Reported-by kernel test robot <[email protected]>
Reported-by Julia Lawall <[email protected]>
Signed-off-by R Sundar <[email protected]>
---
Reported in linux repo.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/usb/typec/tcpm/tcpm.c:6356:20-21: WARNING opportunity for
max()
vim +6356 drivers/usb/typec/tcpm/tcpm.c
compile-tested only.
drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
@@ -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); } }
Signature · 1 line
2.34.1
Quoted 6 lines · R Sundar
Use
max()for better readability and to fix cocci warnings.Reported-by kernel test robot <[email protected]>Reported-by Julia Lawall <[email protected]>Signed-off-by R Sundar <[email protected]>
Reviewed-by Heikki Krogerus <[email protected]>
Quoted 30 lines
---
Reported in linux repo.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git mastercocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/usb/typec/tcpm/tcpm.c:6356:20-21: WARNING opportunity for
max()vim +6356
drivers/usb/typec/tcpm/tcpm.ccompile-tested only.
drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +1
-1@@ -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); } }Signature · 1 line
2.34.1
Signature · 1 line
heikki