From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753374AbdJSMWw (ORCPT ); Thu, 19 Oct 2017 08:22:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:57093 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753069AbdJSMWv (ORCPT ); Thu, 19 Oct 2017 08:22:51 -0400 Date: Thu, 19 Oct 2017 14:22:48 +0200 From: Jean Delvare To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] firmware: dmi: handle missing DMI data gracefully Message-ID: <20171019142248.1566f6ee@endymion> In-Reply-To: <20171017181537.32540-1-ard.biesheuvel@linaro.org> References: <20171017181537.32540-1-ard.biesheuvel@linaro.org> Organization: SUSE Linux X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ard, On Tue, 17 Oct 2017 19:15:37 +0100, Ard Biesheuvel wrote: > Currently, when booting a kernel with DMI support on a platform that has > no DMI tables, the following output is emitted into the kernel log: > > [ 0.128818] DMI not present or invalid. > ... > [ 1.306659] dmi: Firmware registration failed. > ... > [ 2.908681] dmi-sysfs: dmi entry is absent. > > The first one is a pr_info(), but the subsequent ones are pr_err()s that > complain about a condition that is not really an error to begin with. > > So let's clean this up, and give up silently if dma_available is not set. > > Signed-off-by: Ard Biesheuvel > --- > v2: - don't use dmi_available in dmi-sysfs because it is not exported, > instead, change pr_err to pr_debug > > drivers/firmware/dmi-sysfs.c | 2 +- > drivers/firmware/dmi_scan.c | 6 ++---- > 2 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c > index d5de6ee8466d..ecf2eeb5f6f9 100644 > --- a/drivers/firmware/dmi-sysfs.c > +++ b/drivers/firmware/dmi-sysfs.c > @@ -652,7 +652,7 @@ static int __init dmi_sysfs_init(void) > int val; > > if (!dmi_kobj) { > - pr_err("dmi-sysfs: dmi entry is absent.\n"); > + pr_debug("dmi-sysfs: dmi entry is absent.\n"); > error = -ENODATA; > goto err; > } > diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c > index 783041964439..17a7425063c2 100644 > --- a/drivers/firmware/dmi_scan.c > +++ b/drivers/firmware/dmi_scan.c > @@ -715,10 +715,8 @@ static int __init dmi_init(void) > u8 *dmi_table; > int ret = -ENOMEM; > > - if (!dmi_available) { > - ret = -ENODATA; > - goto err; > - } > + if (!dmi_available) > + return 0; > > /* > * Set up dmi directory at /sys/firmware/dmi. This entry should stay Looks good. Applied, thanks! -- Jean Delvare SUSE L3 Support