Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37202 )
Change subject: libpayload: Make pci and endian handling -Wconversion safe ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/37202/1/payloads/libpayload/include... File payloads/libpayload/include/endian.h:
https://review.coreboot.org/c/coreboot/+/37202/1/payloads/libpayload/include... PS1, Line 39: return (uint16_t)((in & 0xFF) << 8) | ((in & 0xFF00) >> 8);
After reading the first paragraph I came to the conclusion that the article is wrong or misguided.
I don't think the article's author has ever tried to poke a hardware register using C.
https://review.coreboot.org/c/coreboot/+/37202/1/payloads/libpayload/libpci/... File payloads/libpayload/libpci/libpci.c:
https://review.coreboot.org/c/coreboot/+/37202/1/payloads/libpayload/libpci/... PS1, Line 43: return pci_read_config8(libpci_to_lb(dev), (uint16_t)pos);
is it worth just forcing the parameter to be a uint?
I don't see why `pos` should be signed at all. However, libpci seems to use this interface...