Messages in this thread | | | Subject | Re: [PATCH v4 8/8] linux/log2.h: Use roundup/dow_pow_two() on 64bit calculations | From | Nicolas Saenz Julienne <> | Date | Tue, 03 Dec 2019 17:06:43 +0100 |
| |
Hi Rob,
On Tue, 2019-12-03 at 09:53 -0600, Rob Herring wrote: > On Tue, Dec 3, 2019 at 5:48 AM Nicolas Saenz Julienne > <nsaenzjulienne@suse.de> wrote: > > The function now is safe to use while expecting a 64bit value. Use it > > where relevant. > > What was wrong with the existing code? This is missing some context.
You're right, I'll update it.
For most of files changed the benefit here is factoring out a common pattern using the standard function roundup/down_pow_two() which now provides correct 64bit results.
As for of/device.c and arm64/iort.c it's more of a readability enhancement. I consider it's easier to understand than the current calculation as it abstracts the math.
> > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> > > --- > > drivers/acpi/arm64/iort.c | 2 +- > > drivers/net/ethernet/mellanox/mlx4/en_clock.c | 3 ++- > > drivers/of/device.c | 3 ++- > > In any case, > > Acked-by: Rob Herring <robh@kernel.org> >
Thanks!
Regards, Nicolas
[unhandled content-type:application/pgp-signature] | |