Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4372886pxv; Mon, 5 Jul 2021 22:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1cxtVgDi+snrq57/rws6TSIi/nXqjjyCxd8Eu39Kwbhgj5TpEP7QSV/2k/rFB7vND0aoC X-Received: by 2002:a05:6602:140e:: with SMTP id t14mr14616129iov.42.1625549331065; Mon, 05 Jul 2021 22:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625549331; cv=none; d=google.com; s=arc-20160816; b=DSLcDrUttT2HENA8DZejPANKPFlBENwzWiEnR+tuTrsL9hjufSC1Hwd0kNnvFbErsF N5YvDu3RhF5t9UCvuMZgM5o4hXWW8nKzKzLOhtj6/Yo2YAgyvMIIi1LawsJGkDLPgpbY 4HT/QOycEyj0xEJEL1YG21+t0PbNCZhq+vJWXX9RQhLmVaRCVZREnLT8xFGHxPx1AedO xPQnp+5RQmYo+w3HbKxPRyz58lZDQ309m0Kf1knxFnH0kmlBuCTJWhqxbldduyDWI15Y XiPX2hAEJOUmxhWEFzdwsR4/v9Rsg7XLJpB9EP8oYYunAIAG7SumjSBsZVEwoBqKkZbf I7FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=o4uKdfkOCf4zr2aP35ktmr+MX6kx+yTkOAZCMzP7LmY=; b=cOU5AaPbADGgD0FYBOmiTVtETs3cYVO+3aw2M4zGN9zEyfQhzjWWx1HXtzVsshbNal N8jr6Pk1uNOucqOUOTTifqSMMRsF2/w6eK6Pq+Dyd3MGnAzNTBo7uAr8HpsU/k2XhuR5 qQHzHbFYZuA8CMbMnA4NJUk9R592RBjiFv1IWFIUHkzs4RWR8MOnWIpGz2ePG5SMic+L 1Eiw+2PtrZXtft7eHzUiTU9qPQxcz8tRo4+OMb9iIDQHrFX6U6JikWk5Qhe/Mp56o/3I OlYyjGrHrtQ61NgnGv4JUPkD01bXTHrnpc3I9RMZLvzrlY+/3Nkd/52qlml8Qsf2Yekt t7eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si2463156ilf.137.2021.07.05.22.28.39; Mon, 05 Jul 2021 22:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbhGFF3m (ORCPT + 99 others); Tue, 6 Jul 2021 01:29:42 -0400 Received: from angie.orcam.me.uk ([78.133.224.34]:60340 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbhGFF3l (ORCPT ); Tue, 6 Jul 2021 01:29:41 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 5AA2092009D; Tue, 6 Jul 2021 07:27:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 5814192009C; Tue, 6 Jul 2021 07:27:02 +0200 (CEST) Date: Tue, 6 Jul 2021 07:27:02 +0200 (CEST) From: "Maciej W. Rozycki" To: Jean Delvare cc: linux-kernel@vger.kernel.org Subject: [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 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some systems do provide DMI entries for Base Board Information, however 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 carries no real information. If it's important to tell an inexistent and an empty board name apart, then all DMI information can be retrieved 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 =================================================================== --- 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)); board = dmi_get_system_info(DMI_BOARD_NAME); - if (board) { + if (board && *board) { c += scnprintf(buf + c, len - c, "/"); c += print_filtered(buf + c, len - c, board); }