Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/53998 )
Change subject: realtek_mst_i2c_spi.c: Rename `PAGE_SIZE` macro ......................................................................
realtek_mst_i2c_spi.c: Rename `PAGE_SIZE` macro
This fixes building with musl libc on alpine:amd64-v3.9.
Change-Id: I043e3d8c2d2498e94b5e7577a7378c8c3e0e6c81 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/53998 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Edward O'Callaghan quasisec@chromium.org --- M realtek_mst_i2c_spi.c 1 file changed, 9 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Edward O'Callaghan: Looks good to me, approved
diff --git a/realtek_mst_i2c_spi.c b/realtek_mst_i2c_spi.c index 64579e1..10a1dff 100644 --- a/realtek_mst_i2c_spi.c +++ b/realtek_mst_i2c_spi.c @@ -28,7 +28,7 @@
#define MCU_I2C_SLAVE_ADDR 0x94 #define REGISTER_ADDRESS (0x94 >> 1) -#define PAGE_SIZE 128 +#define RTK_PAGE_SIZE 128 #define MAX_SPI_WAIT_RETRIES 1000
#define MCU_MODE 0x6F @@ -310,8 +310,8 @@ * Using static buffer with maximum possible size, * extra byte is needed for prefixing the data port register at index 0. */ - uint8_t wbuf[PAGE_SIZE + 1] = { MCU_DATA_PORT }; - if (len > PAGE_SIZE) + uint8_t wbuf[RTK_PAGE_SIZE + 1] = { MCU_DATA_PORT }; + if (len > RTK_PAGE_SIZE) return SPI_GENERIC_ERROR;
memcpy(&wbuf[1], buf, len); @@ -352,9 +352,9 @@ uint8_t dummy; realtek_mst_i2c_spi_read_register(fd, MCU_DATA_PORT, &dummy);
- for (i = 0; i < len; i += PAGE_SIZE) { + for (i = 0; i < len; i += RTK_PAGE_SIZE) { ret |= realtek_mst_i2c_spi_read_data(fd, REGISTER_ADDRESS, - buf + i, min(len - i, PAGE_SIZE)); + buf + i, min(len - i, RTK_PAGE_SIZE)); if (ret) return ret; } @@ -376,11 +376,11 @@ return SPI_GENERIC_ERROR;
ret |= realtek_mst_i2c_spi_write_register(fd, 0x6D, 0x02); /* write opcode */ - ret |= realtek_mst_i2c_spi_write_register(fd, 0x71, (PAGE_SIZE - 1)); /* fit len=256 */ + ret |= realtek_mst_i2c_spi_write_register(fd, 0x71, (RTK_PAGE_SIZE - 1)); /* fit len=256 */
- for (i = 0; i < len; i += PAGE_SIZE) { - uint16_t page_len = min(len - i, PAGE_SIZE); - if (len - i < PAGE_SIZE) + for (i = 0; i < len; i += RTK_PAGE_SIZE) { + uint16_t page_len = min(len - i, RTK_PAGE_SIZE); + if (len - i < RTK_PAGE_SIZE) ret |= realtek_mst_i2c_spi_write_register(fd, 0x71, page_len-1); ret |= realtek_mst_i2c_spi_map_page(fd, start + i); if (ret)