Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/48840 )
Change subject: realtek_mst_i2c_spi.c: Update PAGE_SIZE and fix write ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/flashrom/+/48840/2/realtek_mst_i2c_spi.c File realtek_mst_i2c_spi.c:
https://review.coreboot.org/c/flashrom/+/48840/2/realtek_mst_i2c_spi.c@387 PS2, Line 387: uint8_t block_idx = (start + i) >> 16; : uint8_t page_idx = (start + i) >> 8; : uint8_t byte_idx = start + i; I don't like that this code relies on overflow behavior. I would instead explicitly mask the values (`& 0xff`).
Also, wouldn't it be better to pass `start + i` to `realtek_mst_i2c_spi_map_page` and split the values inside the function? I see this pattern on the two places where `realtek_mst_i2c_spi_map_page` is called.