[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfdDUooc=zy2rk8ep0PdsEsD1TGbaD9nm8DBB1NmYYTTw@mail.gmail.com>
Date: Tue, 13 Feb 2018 20:29:21 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [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@...eddedor.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
Powered by blists - more mailing lists