Re: [PATCH] PCI/ASPM: Use 64-bit arithmetic instead of 32-bit

From: Andy Shevchenko
Date: Tue Feb 13 2018 - 13:29:29 EST


On Tue, Feb 13, 2018 at 6:59 PM, Gustavo A. R. Silva
<garsilva@xxxxxxxxxxxxxx> wrote:
> Add suffix ULL to constant 1000 in order to give the compiler complete
> information about the proper arithmetic to use. Notice that this
> constant is used in a context that expects an expression of type
> u64 (64 bits, unsigned).
>
> The expression threshold_us * 1000 is currently being evaluated
> using 32-bit arithmetic.

> - u64 threshold_ns = threshold_us * 1000;
> + u64 threshold_ns = threshold_us * 1000ULL;

Shouldn't be other way around, i.e.

(u64)threshold_us ?

But still the question. have you checked all callers? Does it even makes sense?

--
With Best Regards,
Andy Shevchenko