hw/nvram: use at24 macro
PATCH 1/1 hw/nvram: use at24 macro
Use the macro for going from I2CSlave to EEPROMState.
Signed-off-by Patrick Venture <[email protected]>
--- hw/nvram/eeprom_at24c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/nvram/eeprom_at24c.c +1 -1
@@ -54,7 +54,7 @@ struct EEPROMState {static int at24c_eeprom_event (I2CSlave *s,enum i2c_event event) { -EEPROMState *ee =container_of (s, EEPROMState, parent_obj); +EEPROMState *ee =AT24C_EE (s);switch (event) {case I2C_START_SEND :
Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog
Quoted 6 lines · Patrick Venture
Use the macro for going from I2CSlave to EEPROMState.
Signed-off-by Patrick Venture <[email protected]>--- hw/nvram/eeprom_at24c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 21 lines · Patrick Venture
Use the macro for going from I2CSlave to EEPROMState.
Signed-off-by Patrick Venture <[email protected]>--- hw/nvram/eeprom_at24c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/nvram/eeprom_at24c.c +1
-2@@ -54,7 +54,7 @@ struct EEPROMState {static int at24c_eeprom_event (I2CSlave *s,enum i2c_event event) { -EEPROMState *ee =container_of (s, EEPROMState, parent_obj); +EEPROMState *ee =AT24C_EE (s);switch (event) {case I2C_START_SEND : --
Quoted 2 lines
2.34.1.703.g22d0c6ccf7-goog
+Corey - thanks!
Quoted 12 lines · Patrick Venture
Use the macro for going from I2CSlave to EEPROMState.
Signed-off-by Patrick Venture <[email protected]>--- hw/nvram/eeprom_at24c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/nvram/eeprom_at24c.c +0
-0
hw/nvram/eeprom_at24c.c struct EEPROMState { · line 60
Quoted 8 lines
hw/nvram/eeprom_at24c.c +1
-1@@ -54,7 +54,7 @@ struct EEPROMState {static int at24c_eeprom_event (I2CSlave *s,enum i2c_event event) { -EEPROMState *ee =container_of (s, EEPROMState, parent_obj); +EEPROMState *ee =AT24C_EE (s);switch (event) {case I2C_START_SEND :
Laurent Vivier
AppliedLe 25/01/2022 à 10:20, Paolo Bonzini a écrit :
Quoted 8 lines · Patrick Venture
Quoted 7 lines
Use the macro for going from I2CSlave to EEPROMState.
Signed-off-by Patrick Venture <[email protected]>---
hw/nvram/eeprom_at24c.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 5 lines
hw/nvram/eeprom_at24c.c +0
-0@@ -54,7 +54,7 @@ struct EEPROMState {Quoted 7 lines
static
intat24c_eeprom_event(I2CSlave *s, enum i2c_event event){
- EEPROMState *ee =container_of(s, EEPROMState, parent_obj); + EEPROMState *ee =AT24C_EE(s);
switch (event) {
caseI2C_START_SEND:
Applied to my trivial-patches branch.
Thanks,
Laurent