lkml.org 
[lkml]   [2019]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 7/8] linux/log2.h: Fix 64bit calculations in roundup/down_pow_two()
On Tue, Dec 03, 2019 at 12:47:40PM +0100, Nicolas Saenz Julienne wrote:
> Some users need to make sure their rounding function accepts and returns
> 64bit long variables regardless of the architecture. Sadly
> roundup/rounddown_pow_two() takes and returns unsigned longs. It turns
> out ilog2() already handles 32/64bit calculations properly, and being
> the building block to the round functions we can rework them as a
> wrapper around it.
>
> Suggested-by: Robin Murphy <robin.murphy@arm.con>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
> drivers/clk/clk-divider.c | 8 ++--
> drivers/clk/sunxi/clk-sunxi.c | 2 +-
> drivers/infiniband/hw/hfi1/chip.c | 4 +-
> drivers/infiniband/hw/hfi1/init.c | 4 +-
> drivers/infiniband/hw/mlx4/srq.c | 2 +-
> drivers/infiniband/hw/mthca/mthca_srq.c | 2 +-
> drivers/infiniband/sw/rxe/rxe_qp.c | 4 +-


Thanks, for infiniband.
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

\
 
 \ /
  Last update: 2019-12-05 09:13    [W:0.119 / U:2.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site