On Mon, 11 Jan 2021 14:02:50 +0100,
Geert Uytterhoeven wrote:
>
> As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 10L,
> the second multiplication in
>
> ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250
>
> always overflows on 32-bit platforms, truncating the result. Fix this
Hi,
On Mon, Jan 11, 2021 at 02:02:50PM +0100, Geert Uytterhoeven wrote:
> As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 10L,
> the second multiplication in
>
> ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250
>
> always overflows on 32-bit platforms, truncating the result.
As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 10L,
the second multiplication in
ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250
always overflows on 32-bit platforms, truncating the result. Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.
Not
3 matches
Mail list logo