hw/mips/malta: Use sdram_type enum from 'hw/i2c/smbus_eeprom.h'
PATCH 1/1 hw/mips/malta: Use sdram_type enum from 'hw/i2c/smbus_eeprom.h'
Since commit 93198b6cad ("i2c: Split smbus into parts") the SDRAM types are enumerated as sdram_type in "hw/i2c/smbus_eeprom.h".
Using the enum removes this global shadow warning:
hw/mips/malta.c:209:12: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
enum { SDR = 0x4, DDR2 = 0x8 } type;
^
include/hw/i2c/smbus_eeprom.h:33:19: note: previous declaration is here
enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 };
^--- hw/mips/malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/malta.c +1 -1
@@ -206,7 +206,7 @@ static eeprom24c0x_t spd_eeprom = {static void generate_eeprom_spd (uint8_t *eeprom,ram_addr_t ram_size) { -enum {SDR =0x4 ,DDR2 =0x8 } type; +enum sdram_type type;uint8_t *spd = spd_eeprom.contents;uint8_t nbanks =0 ;uint16_t density =0 ;
Signature · 1 line
2.41.0
Quoted 5 lines · Philippe Mathieu-Daudé
Since commit
93198b6cad("i2c: Split smbus into parts") the SDRAM types are enumerated assdram_typein "hw/i2c/smbus_eeprom.h".Using the enum removes this global shadow warning:
Quoted 8 lines
hw/mips/malta.c:209:12: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]enum { SDR = 0x4, DDR2 = 0x8 } type; ^ include/hw/i2c/smbus_eeprom.h:33:19: note: previous declaration is here enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 }; ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 18 lines
---
hw/mips/malta.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/mips/malta.c +1
-1@@ -206,7 +206,7 @@ static eeprom24c0x_t spd_eeprom = {static void generate_eeprom_spd (uint8_t *eeprom,ram_addr_t ram_size) { -enum {SDR =0x4 ,DDR2 =0x8 } type; +enum sdram_type type;uint8_t *spd = spd_eeprom.contents;uint8_t nbanks =0 ;uint16_t density =0 ;
Quoted 5 lines · Philippe Mathieu-Daudé
Since commit
93198b6cad("i2c: Split smbus into parts") the SDRAM types are enumerated assdram_typein "hw/i2c/smbus_eeprom.h".Using the enum removes this global shadow warning:
Quoted 8 lines
hw/mips/malta.c:209:12: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] enum { SDR = 0x4, DDR2 = 0x8 } type; ^ include/hw/i2c/smbus_eeprom.h:33:19: note: previous declaration is here enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 }; ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>
r~
Philippe Mathieu-Daudé
AppliedQuoted 12 lines · Philippe Mathieu-Daudé
Since commit
93198b6cad("i2c: Split smbus into parts") the SDRAM types are enumerated assdram_typein "hw/i2c/smbus_eeprom.h".Using the enum removes this global shadow warning:
hw/mips/malta.c:209:12: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] enum { SDR = 0x4, DDR2 = 0x8 } type; ^ include/hw/i2c/smbus_eeprom.h:33:19: note: previous declaration is here enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 }; ^
Quoted 4 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/mips/malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Queued to mips-next.