From 87531ef11c00963100f20fac71c2428f54162916 Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Tue, 17 Jan 2023 16:20:53 +1100 Subject: tests: Fix warnings for 32-bit Linux 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 Change-Id: I9ec5d37cc038171afc67a69ea9a6885deb8fa4a8 Tested-By: Branden Waldner Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/72038 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Alexander Goncharov --- tests/linux_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/linux_spi.c b/tests/linux_spi.c index 10096345f..1b653fefd 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 */ -- cgit v1.2.3