Anastasia Klimchuk submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Alexander Goncharov: Looks good to me, but someone else must approve
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 <scruffy99@gmail.com>
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72038
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Alexander Goncharov <chat@joursoir.net>
---
M tests/linux_spi.c
1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/tests/linux_spi.c b/tests/linux_spi.c
index 1009634..1b653fe 100644
--- a/tests/linux_spi.c
+++ b/tests/linux_spi.c
@@ -23,14 +23,14 @@

/* 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 */

To view, visit change 72038. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9ec5d37cc038171afc67a69ea9a6885deb8fa4a8
Gerrit-Change-Number: 72038
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Alexander Goncharov <chat@joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Branden Waldner <scruffy99@gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Felix Singer <felixsinger@posteo.net>
Gerrit-MessageType: merged