Thread (15 messages) 15 messages, 8 authors, 2019-12-12

Re: [PATCH v4 7/8] linux/log2.h: Fix 64bit calculations in roundup/down_pow_two()

From: Leon Romanovsky <leon@kernel.org>
Date: 2019-12-05 08:12:34
Also in: kexec, linux-clk, linux-iommu, linux-nfs, linux-pci, linux-rdma, lkml

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 <redacted>
Signed-off-by: Nicolas Saenz Julienne <redacted>
---
 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 <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help