Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/29442
Change subject: payloads/libpayload/drivers/storage: Get rid of void pointer math ......................................................................
payloads/libpayload/drivers/storage: Get rid of void pointer math
Pointer math with void pointers is illegal in many compilers, though it works with GCC because it assumes size of void to be 1. In this particular situation, dev->buf is already pointer to u8, and there's no need to convert to void *.
BUG=b:118484178 TEST=Build libpayload.
Change-Id: Ib70b8ce11abc88c35be4092f097cfff385921f46 Signed-off-by: Richard Spiegel richard.spiegel@silverbackltd.com --- M payloads/libpayload/drivers/storage/ahci_common.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/29442/1
diff --git a/payloads/libpayload/drivers/storage/ahci_common.c b/payloads/libpayload/drivers/storage/ahci_common.c index bcb0ce7..ef9d43d 100644 --- a/payloads/libpayload/drivers/storage/ahci_common.c +++ b/payloads/libpayload/drivers/storage/ahci_common.c @@ -72,7 +72,7 @@ if ((u32)user_buf & 1) { printf("ahci: Odd buffer pointer (%p).\n", user_buf); if (dev->buf) /* orphaned buffer */ - free((void *)dev->buf - *(dev->buf - 1)); + free(dev->buf - *(dev->buf - 1)); dev->buf = malloc(len + 2); if (!dev->buf) return NULL; @@ -100,7 +100,7 @@ if (dev->buf) { if (dev->write_back) memcpy(dev->user_buf, dev->buf, dev->buflen); - free((void *)dev->buf - *(dev->buf - 1)); + free(dev->buf - *(dev->buf - 1)); } dev->buf = NULL; dev->user_buf = NULL;