]> www.infradead.org Git - users/willy/xarray.git/commit
net: mvpp2: Improve data types and use min()
authorThorsten Blum <thorsten.blum@toblux.com>
Thu, 11 Jul 2024 15:47:43 +0000 (17:47 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jul 2024 22:43:05 +0000 (15:43 -0700)
commitf7023b3d697c6a7dfe2d9c70e0d8c2c580ccbd76
tree1d35ef2c9775ce118b2983f5b1bd90eee165e5f1
parent275a63c9fe10f39066782d2d775d7d3efb20b01f
net: mvpp2: Improve data types and use min()

Change the data type of the variable freq in mvpp2_rx_time_coal_set()
and mvpp2_tx_time_coal_set() to u32 because port->priv->tclk also has
the data type u32.

Change the data type of the function parameter clk_hz in
mvpp2_usec_to_cycles() and mvpp2_cycles_to_usec() to u32 accordingly
and remove the following Coccinelle/coccicheck warning reported by
do_div.cocci:

  WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead

Use min() to simplify the code and improve its readability.

Compile-tested only.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240711154741.174745-1-thorsten.blum@toblux.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c