Angel Pons has uploaded this change for review.

View Change

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>
---
M realtek_mst_i2c_spi.c
1 file changed, 9 insertions(+), 9 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/98/53998/1
diff --git a/realtek_mst_i2c_spi.c b/realtek_mst_i2c_spi.c
index 64579e1..1b8ef72 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 REALTEK_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[REALTEK_PAGE_SIZE + 1] = { MCU_DATA_PORT };
+ if (len > REALTEK_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 += REALTEK_PAGE_SIZE) {
ret |= realtek_mst_i2c_spi_read_data(fd, REGISTER_ADDRESS,
- buf + i, min(len - i, PAGE_SIZE));
+ buf + i, min(len - i, REALTEK_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, (REALTEK_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 += REALTEK_PAGE_SIZE) {
+ uint16_t page_len = min(len - i, REALTEK_PAGE_SIZE);
+ if (len - i < REALTEK_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)

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I043e3d8c2d2498e94b5e7577a7378c8c3e0e6c81
Gerrit-Change-Number: 53998
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-MessageType: newchange