On Tue, Feb 13, 2018 at 6:59 PM, Gustavo A. R. Silva
<garsi...@embeddedor.com> 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

Reply via email to