diff options
author | Anastasia Klimchuk <aklm@chromium.org> | 2023-01-17 16:20:53 +1100 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2023-01-21 07:32:07 +0000 |
commit | 7247435eb0be5506a2869c5c863dba3fa55ddc69 (patch) | |
tree | e4ec3298d740c9235347ffd4f62438cdc5851778 | |
parent | 53dc84d61447adbb536e0085441c979e171e98c9 (diff) | |
download | flashrom-1.3.x.tar.gz flashrom-1.3.x.tar.bz2 flashrom-1.3.x.zip |
tests: Fix warnings for 32-bit Linuxv1.3.0-rc2v1.3.01.3.x
Unit tests had int-to-pointer-cast warnings for 32-bit Linux
environment, and since warnings are treated as errors this
failed build with unit tests.
Ticket: https://ticket.coreboot.org/issues/407
Original-Tested-By: Branden Waldner <scruffy99@gmail.com>
Original-Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/72038
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Original-Reviewed-by: Alexander Goncharov <chat@joursoir.net>
(cherry picked from commit 87531ef11c00963100f20fac71c2428f54162916)
Change-Id: I9ec5d37cc038171afc67a69ea9a6885deb8fa4a8
Signed-off-by: Evan Benn <evanbenn@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/71285
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: Anastasia Klimchuk <aklm@chromium.org>
-rw-r--r-- | tests/linux_spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/linux_spi.c b/tests/linux_spi.c index 2e3dc95f4..d71e5b48e 100644 --- a/tests/linux_spi.c +++ b/tests/linux_spi.c @@ -23,14 +23,14 @@ static int linux_spi_ioctl(void *state, int fd, unsigned long request, va_list a /* First message has write array and write count */ unsigned int writecnt = msg[0].len; - unsigned char *writearr = (unsigned char *)msg[0].tx_buf; + unsigned char *writearr = (unsigned char *)(uintptr_t)msg[0].tx_buf; /* Second message has read array and read count */ unsigned int readcnt = msg[1].len; /* Detect probing */ if (writecnt == 1 && writearr[0] == JEDEC_RDID && readcnt == 3) { /* We need to populate read array. */ - unsigned char *readarr = (unsigned char *)msg[1].rx_buf; + unsigned char *readarr = (unsigned char *)(uintptr_t)msg[1].rx_buf; readarr[0] = 0xEF; /* WINBOND_NEX_ID */ readarr[1] = 0x40; /* WINBOND_NEX_W25Q128_V left byte */ readarr[2] = 0x18; /* WINBOND_NEX_W25Q128_V right byte */ |