Thread (11 messages) 11 messages, 3 authors, 2019-11-21

Re: [PATCH v2 1/6] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions

From: Nicolas Saenz Julienne <hidden>
Date: 2019-11-19 11:30:53
Also in: linux-arm-kernel, linux-pci, linux-rdma, linux-rockchip, lkml

Hi Andrew, thanks for the review.
quoted
+/**
+ * __roundup_pow_of_two64() - round 64bit value up to nearest power of two
+ * @n: value to round up
+ */
+static inline __attribute__((const)) __u64 __roundup_pow_of_two64(__u64 n)
To be consistent with other functions in the same file (__ilog_u64) you may
want to rename this to __roundup_pow_of_two_u64.
Sounds good to me.
Also do you know why u64 is used in some places and __u64 in others?
That's unwarranted, it should be __u64 everywhere.
quoted
+{
+	return 1UL << fls64(n - 1);
Does this need to be (and for the others):

return 1ULL << fls64(n - 1);

Notice that the PCI drivers you convert, all use 1ULL.
Noted

Regards,
Nicolas

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help