Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit f7023b3d authored by Thorsten Blum's avatar Thorsten Blum Committed by Jakub Kicinski
Browse files

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: default avatarThorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240711154741.174745-1-thorsten.blum@toblux.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 275a63c9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment