Let this function return a string, as we typically do, to avoid duplicating the print call.
Signed-off-by: Jean Delvare <[email protected]> --- dmidecode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/dmidecode.c +++ b/dmidecode.c @@ -2992,7 +2992,7 @@ static void dmi_memory_device_speed(cons } } -static void dmi_memory_technology(u8 code) +static const char *dmi_memory_technology(u8 code) { /* 7.18.6 */ static const char * const technology[] = { @@ -3006,9 +3006,8 @@ static void dmi_memory_technology(u8 cod "MRDIMM" /* 0x08 */ }; if (code >= 0x01 && code <= 0x08) - pr_attr("Memory Technology", "%s", technology[code - 0x01]); - else - pr_attr("Memory Technology", "%s", out_of_spec); + return technology[code - 0x01]; + return out_of_spec; } static void dmi_memory_operating_mode_capability(u16 code) @@ -5000,7 +4999,8 @@ static void dmi_decode(const struct dmi_ dmi_memory_voltage_value("Configured Voltage", WORD(data + 0x26)); if (h->length < 0x34) break; - dmi_memory_technology(data[0x28]); + pr_attr("Memory Technology", "%s", + dmi_memory_technology(data[0x28])); dmi_memory_operating_mode_capability(WORD(data + 0x29)); pr_attr("Firmware Version", "%s", dmi_string(h, data[0x2B])); -- Jean Delvare SUSE L3 Support
