Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45938 )
Change subject: lib and libpayload: add 64-bit versions of clz, __ffs and log2 ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45938/2/src/include/lib.h File src/include/lib.h:
https://review.coreboot.org/c/coreboot/+/45938/2/src/include/lib.h@59 PS2, Line 59: clz64
nit: IMHO, `clzll` or `clz_ll` feels more consistent, and using `log2_ll` leads to less confusion th […]
Really? I would say the opposite. I think the whole short, long, long long, etc. C type system is terrible and it's best to avoid using it as much as possible (like we mostly do in coreboot). It leads to exactly these kinds of issues where nobody knows whether a 64-bit value should be long or long long or what, because it's completely dependent on architecture and a bunch of other factors.
Just like the htonl() byte swapping names are terrible and we replace them with clearer stuff like htobe32() where possible, I think we should use exact numbers here as well.