Re: [PATCH net-next] net: mvpp2: Improve data types and use min()

From: Simon Horman
Date: Fri Jul 12 2024 - 14:25:14 EST


On Thu, Jul 11, 2024 at 05:47:43PM +0200, Thorsten Blum wrote:
> 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@xxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>