diff options
author | Jacob Garber <jgarber1@ualberta.ca> | 2019-07-25 15:45:53 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-07-29 06:01:16 +0000 |
commit | 321daa86efebbe766afa4f6a023ecd6888be6ff8 (patch) | |
tree | f4bf877793b67f753eaa742dd059501fe90b36bb /src/vendorcode/cavium/bdk | |
parent | 336420348eed277f8640fc9c19aa463c2848650d (diff) |
vc/cavium/bdk/libdram: Print unknown voltages
volt_str is used to print information about the RAM configuration
in report_common_dimm(), so let's print out "unknown voltage" if the
voltage isn't recognized rather than a garbage value.
Change-Id: I8e85917fd682e166172fbf10597bde4a8a11dfc7
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 1393958, 1393982
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34576
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/vendorcode/cavium/bdk')
-rw-r--r-- | src/vendorcode/cavium/bdk/libdram/dram-spd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vendorcode/cavium/bdk/libdram/dram-spd.c b/src/vendorcode/cavium/bdk/libdram/dram-spd.c index 84df69a923..894a0604c4 100644 --- a/src/vendorcode/cavium/bdk/libdram/dram-spd.c +++ b/src/vendorcode/cavium/bdk/libdram/dram-spd.c @@ -424,7 +424,7 @@ void report_ddr3_dimm(bdk_node_t node, const dimm_config_t *dimm_config, int dram_width, int dimm_size_mb) { int spd_voltage; - const char *volt_str; + const char *volt_str = "unknown voltage"; spd_voltage = read_spd(node, dimm_config, DDR3_SPD_NOMINAL_VOLTAGE); if ((spd_voltage == 0) || (spd_voltage & 3)) @@ -464,7 +464,7 @@ void report_ddr4_dimm(bdk_node_t node, const dimm_config_t *dimm_config, int dram_width, int dimm_size_mb) { int spd_voltage; - const char *volt_str; + const char *volt_str = "unknown voltage"; spd_voltage = read_spd(node, dimm_config, DDR4_SPD_MODULE_NOMINAL_VOLTAGE); if ((spd_voltage == 0x01) || (spd_voltage & 0x02)) |