From nobody Wed Jul 1 04:19:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59B52C433EF for ; Sun, 2 Jan 2022 23:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231340AbiABXdN (ORCPT ); Sun, 2 Jan 2022 18:33:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbiABXcz (ORCPT ); Sun, 2 Jan 2022 18:32:55 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9988AC061792 for ; Sun, 2 Jan 2022 15:32:54 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 565129200BC; Mon, 3 Jan 2022 00:24:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 528F79200BB; Sun, 2 Jan 2022 23:24:09 +0000 (GMT) Date: Sun, 2 Jan 2022 23:24:09 +0000 (GMT) From: "Maciej W. Rozycki" To: Jean Delvare cc: linux-kernel@vger.kernel.org Subject: [RESEND][PATCH 1/2] firmware: dmi: Prevent empty board name from being logged In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some systems do provide DMI entries for Base Board Information, however=20 the strings supplied are null, e.g: Legacy DMI 2.0 present. DMI: /, BIOS 4.51 PG 09/11/97 Do not log the slash along with the empty board name in that case as it=20 carries no real information. If it's important to tell an inexistent=20 and an empty board name apart, then all DMI information can be retrieved=20 from sysfs and/or with `dmidecode'. Signed-off-by: Maciej W. Rozycki --- drivers/firmware/dmi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-macro-ide-tty/drivers/firmware/dmi_scan.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro-ide-tty.orig/drivers/firmware/dmi_scan.c +++ linux-macro-ide-tty/drivers/firmware/dmi_scan.c @@ -544,7 +544,7 @@ static void __init dmi_format_ids(char * dmi_get_system_info(DMI_PRODUCT_NAME)); =20 board =3D dmi_get_system_info(DMI_BOARD_NAME); - if (board) { + if (board && *board) { c +=3D scnprintf(buf + c, len - c, "/"); c +=3D print_filtered(buf + c, len - c, board); } From nobody Wed Jul 1 04:19:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B5AFC433F5 for ; Sun, 2 Jan 2022 23:33:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231266AbiABXdJ (ORCPT ); Sun, 2 Jan 2022 18:33:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbiABXcz (ORCPT ); Sun, 2 Jan 2022 18:32:55 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8EF9EC061785 for ; Sun, 2 Jan 2022 15:32:54 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 923099200C0; Mon, 3 Jan 2022 00:24:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 8E6649200BF; Sun, 2 Jan 2022 23:24:14 +0000 (GMT) Date: Sun, 2 Jan 2022 23:24:14 +0000 (GMT) From: "Maciej W. Rozycki" To: Jean Delvare cc: linux-kernel@vger.kernel.org Subject: [RESEND][PATCH 2/2] firmware: dmi: Log board vendor if no system vendor has been given In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some systems do not provide any names with System Information, e.g. the=20 Tyan Tomcat IV S1564D mainboard reports: Legacy DMI 2.0 present. DMI: /i430HX, BIOS 4.51 PG 05/13/98 This is not unreasonable given that it was retailed as a bare mainboard=20 rather that a complete system, so no information could have been known=20 about the integrator. It does have the manufacturer correctly recorded=20 with Base Board Information though: Handle 0x0001 DMI type 1, 8 bytes. System Information Manufacturer: Product Name: Version: Serial Number: Handle 0x0002 DMI type 2, 8 bytes. Base Board Information Manufacturer: Tyan Computer Corp Product Name: i430HX Version: Serial Number: Resort to logging the board manufacturer then if none has been given for=20 the system. Also refrain from including the separating slash if no name=20 has been given for the system. Output is now: Legacy DMI 2.0 present. DMI: Tyan Computer Corp i430HX, BIOS 4.51 PG 05/13/98 for said board, surely more informative (of course a better name could=20 have been chosen for the product than just "i430HX", but there you go). Signed-off-by: Maciej W. Rozycki --- drivers/firmware/dmi_scan.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) linux-dmi-board-vendor.diff Index: linux-macro-ide-tty/drivers/firmware/dmi_scan.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro-ide-tty.orig/drivers/firmware/dmi_scan.c +++ linux-macro-ide-tty/drivers/firmware/dmi_scan.c @@ -535,17 +535,23 @@ static int __init print_filtered(char *b static void __init dmi_format_ids(char *buf, size_t len) { int c =3D 0; + const char *vendor; const char *board; /* Board Name is optional */ + const char *name; =20 - c +=3D print_filtered(buf + c, len - c, - dmi_get_system_info(DMI_SYS_VENDOR)); + vendor =3D dmi_get_system_info(DMI_SYS_VENDOR); + if (!vendor || !*vendor) + vendor =3D dmi_get_system_info(DMI_BOARD_VENDOR); + c +=3D print_filtered(buf + c, len - c, vendor); c +=3D scnprintf(buf + c, len - c, " "); - c +=3D print_filtered(buf + c, len - c, - dmi_get_system_info(DMI_PRODUCT_NAME)); + + name =3D dmi_get_system_info(DMI_PRODUCT_NAME); + c +=3D print_filtered(buf + c, len - c, name); =20 board =3D dmi_get_system_info(DMI_BOARD_NAME); if (board && *board) { - c +=3D scnprintf(buf + c, len - c, "/"); + if (name && *name) + c +=3D scnprintf(buf + c, len - c, "/"); c +=3D print_filtered(buf + c, len - c, board); } c +=3D scnprintf(buf + c, len - c, ", BIOS ");