1 comment:
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.
To view, visit change 48840. To unsubscribe, or for help writing mail filters, visit settings.