From 3c111e4f6134855580f20f8e01fee26eff455fff Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 10 Dec 2020 11:21:49 +0100 Subject: dmidecode: Use _dmi_string for dmi_set_vendor The strings passed to dmi_set_vendor will never be printed, they are used for comparison purposes only, so the pre- and post-processing done by dmi_string is not needed. Call _dmi_string instead, which is faster. Signed-off-by: Jean Delvare --- dmidecode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dmidecode.c') diff --git a/dmidecode.c b/dmidecode.c index 4c98553..27d5494 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -5243,7 +5243,8 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags) /* assign vendor for vendor-specific decodes later */ if (h.type == 1 && h.length >= 6) - dmi_set_vendor(dmi_string(&h, data[0x04]), dmi_string(&h, data[0x5])); + dmi_set_vendor(_dmi_string(&h, data[0x04], 0), + _dmi_string(&h, data[0x05], 0)); /* Fixup a common mistake */ if (h.type == 34) -- cgit v1.2.1