On Mon, 11 Jan 2021 14:02:51 +0100,
Geert Uytterhoeven wrote:
>
> As snd_fw_async_midi_port.consume_bytes is unsigned int, and
> NSEC_PER_SEC is 10L, the second multiplication in
>
> port->consume_bytes * 8 * NSEC_PER_SEC / 31250
>
> always overflows on 32-bit platforms, truncating
Hi Sakamoto-san,
On Tue, Jan 12, 2021 at 2:43 PM Takashi Sakamoto
wrote:
> On Mon, Jan 11, 2021 at 02:02:51PM +0100, Geert Uytterhoeven wrote:
> > As snd_fw_async_midi_port.consume_bytes is unsigned int, and
> > NSEC_PER_SEC is 10L, the second multiplication in
> >
> >
Hi,
On Mon, Jan 11, 2021 at 02:02:51PM +0100, Geert Uytterhoeven wrote:
> As snd_fw_async_midi_port.consume_bytes is unsigned int, and
> NSEC_PER_SEC is 10L, the second multiplication in
>
> port->consume_bytes * 8 * NSEC_PER_SEC / 31250
>
> always overflows on 32-bit platforms,
As snd_fw_async_midi_port.consume_bytes is unsigned int, and
NSEC_PER_SEC is 10L, the second multiplication in
port->consume_bytes * 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
4 matches
Mail list logo