Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32184 )
Change subject: libpayload: make log2 and clz work on signed values internally
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/32184/1/payloads/libpayload/include/libpaylo...
File payloads/libpayload/include/libpayload.h:
https://review.coreboot.org/#/c/32184/1/payloads/libpayload/include/libpaylo...
PS1, Line 414: static inline int log2(u32 x) { return (int)sizeof(x) * 8 - clz(x) - 1; }
This could also be simplified to 32, no? (or even 31)
I went for the type cast in both instances instead
--
To view, visit
https://review.coreboot.org/c/coreboot/+/32184
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie193e39854d2231b6d09a2b0deeeef2873e900ab
Gerrit-Change-Number: 32184
Gerrit-PatchSet: 2
Gerrit-Owner: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Patrick Rudolph
siro@das-labor.org
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Jacob Garber
jgarber1@ualberta.ca
Gerrit-Comment-Date: Wed, 15 May 2019 21:45:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jacob Garber
jgarber1@ualberta.ca
Gerrit-MessageType: comment