lkml.org 
[lkml]   [2018]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] PCI/ASPM: Use 64-bit arithmetic instead of 32-bit
On Tue, Feb 13, 2018 at 6:59 PM, Gustavo A. R. Silva
<garsilva@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

\
 
 \ /
  Last update: 2018-02-13 19:29    [W:0.064 / U:5.252 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site