]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: typec: tipd: use min() to set tps6598x firmware packet size
authorJavier Carrasco <javier.carrasco@wolfvision.net>
Thu, 6 Jun 2024 09:03:57 +0000 (11:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2024 17:30:16 +0000 (19:30 +0200)
commit2bc0bea11c6112e61fbd663c993892ee56956577
tree7245a81010d5768189855e55f4ad7c9d49f7fcf6
parent916b8e5fa73d399a61156da7d914abfae74b962b
usb: typec: tipd: use min() to set tps6598x firmware packet size

Simplify the current firmware packet size check in the tps6598x
implementation by means of a single call to min(), which is what the
current code does in a more verbose, less elegant way.

This patch fixes a cocci warning ("WARNING opportunity for min()").

Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240606-tps6598x_fw_update_log-v1-3-2b5b8369a0ba@wolfvision.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tipd/core.c