On 7/5/26 14:05, Nicholas Piggin wrote:
Alistair suggested moving to Fifo8, which I think is
a good improvement.

Broken out for individual review, but IMO we should
squash before merge since it changes VMState format.

Signed-off-by: Nicholas Piggin <[email protected]>
---
  hw/i2c/designware_i2c.c         | 37 ++++++++++++++++++++-------------
  include/hw/i2c/designware_i2c.h |  7 +++----
  2 files changed, 25 insertions(+), 19 deletions(-)


@@ -53,8 +54,6 @@ typedef enum DesignWareI2CStatus {
   * @ic_comp_version: I2C component version register
   * @ic_comp_type: I2C component type register
   * @rx_fifo: The FIFO buffer for receiving in FIFO mode.
- * @rx_cur: The current position of rx_fifo.
- * @status: The current status of the SMBus.
   */
  typedef struct DesignWareI2CState {
      SysBusDevice parent_obj;
@@ -88,8 +87,8 @@ typedef struct DesignWareI2CState {
      uint32_t ic_comp_version;
      uint32_t ic_comp_type;
- uint8_t rx_fifo[DESIGNWARE_I2C_RX_FIFO_SIZE];
-    uint8_t      rx_cur;
+    /* fifo8_num_used(rx_fifo) should always equal ic_rxflr */

Why not remove ic_rxflr then?

+    Fifo8    rx_fifo;
DesignWareI2CStatus status;
  } DesignWareI2CState;


Reply via email to