From 9eb0b19861652f20d5f9153785ab307e70222a36 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 7 Nov 2023 11:00:21 +0100 Subject: drivers/i2c/lenovo_serials: Use buildtime constants The coreboot_version global variable just gets filled with the COREBOOT_VERSION macro so there is no reason to use a runtime strconcat. Signed-off-by: Arthur Heymans Change-Id: I3a2be7293d07ac591855ebd784bba350cdffa70f Reviewed-on: https://review.coreboot.org/c/coreboot/+/78945 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/drivers/i2c/at24rf08c/Makefile.inc | 1 + src/drivers/i2c/at24rf08c/lenovo_serials.c | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/drivers/i2c') diff --git a/src/drivers/i2c/at24rf08c/Makefile.inc b/src/drivers/i2c/at24rf08c/Makefile.inc index 4ac3f1d75f..4ef2bc595c 100644 --- a/src/drivers/i2c/at24rf08c/Makefile.inc +++ b/src/drivers/i2c/at24rf08c/Makefile.inc @@ -1,4 +1,5 @@ ## SPDX-License-Identifier: GPL-2.0-only ramstage-$(CONFIG_DRIVER_LENOVO_SERIALS) += at24rf08c.c +$(call src-to-obj,ramstage,$(dir)/lenovo_serials.c) : $(obj)/build.h ramstage-$(CONFIG_DRIVER_LENOVO_SERIALS) += lenovo_serials.c diff --git a/src/drivers/i2c/at24rf08c/lenovo_serials.c b/src/drivers/i2c/at24rf08c/lenovo_serials.c index bc01969b5a..dd09dda7fe 100644 --- a/src/drivers/i2c/at24rf08c/lenovo_serials.c +++ b/src/drivers/i2c/at24rf08c/lenovo_serials.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include #include @@ -183,16 +184,11 @@ const char *smbios_mainboard_version(void) const char *smbios_mainboard_bios_version(void) { - static char *s = NULL; - /* Satisfy thinkpad_acpi. */ if (strlen(CONFIG_LOCALVERSION)) return "CBET4000 " CONFIG_LOCALVERSION; - if (s != NULL) - return s; - s = strconcat("CBET4000 ", coreboot_version); - return s; + return "CBET4000 " COREBOOT_VERSION; } const char *smbios_mainboard_manufacturer(void) -- cgit v1.2.3