From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753335AbdH2NR0 (ORCPT ); Tue, 29 Aug 2017 09:17:26 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60628 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752002AbdH2NRY (ORCPT ); Tue, 29 Aug 2017 09:17:24 -0400 From: Punit Agrawal To: Borislav Petkov Cc: linux-acpi@vger.kernel.org, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-kernel@vger.kernel.org, "Rafael J . Wysocki" , James Morse Subject: Re: [PATCH v2] ACPI / APEI: Suppress message if HEST not present References: <20170816112753.12085-1-punit.agrawal@arm.com> <20170829123815.2z6hoclakznophom@pd.tnic> Date: Tue, 29 Aug 2017 14:17:22 +0100 In-Reply-To: <20170829123815.2z6hoclakznophom@pd.tnic> (Borislav Petkov's message of "Tue, 29 Aug 2017 14:38:15 +0200") Message-ID: <87pobeh5st.fsf@e105922-lin.cambridge.arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Borislav Petkov writes: > On Wed, Aug 16, 2017 at 12:27:53PM +0100, Punit Agrawal wrote: >> According to the ACPI specification, firmware is not required to provide >> the Hardware Error Source Table (HEST). When HEST is not present, the >> following superfluous message is printed to the kernel boot log - >> >> [ 3.460067] GHES: HEST is not enabled! >> >> Extend hest_disable variable to track whether the firmware provides this >> table and if it is not present skip any log output. The existing >> behaviour is preserved in all other cases. >> >> Suggested-by: Borislav Petkov >> Signed-off-by: Punit Agrawal >> Cc: Borislav Petkov >> Cc: James Morse >> --- >> drivers/acpi/apei/ghes.c | 4 ++-- >> drivers/acpi/apei/hest.c | 13 +++++++------ >> include/acpi/apei.h | 8 +++++++- >> 3 files changed, 16 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c >> index d661d452b238..f8685bcbeff2 100644 >> --- a/drivers/acpi/apei/ghes.c >> +++ b/drivers/acpi/apei/ghes.c >> @@ -1262,10 +1262,10 @@ static int __init ghes_init(void) >> { >> int rc; >> >> - if (acpi_disabled) >> + if (acpi_disabled || hest_disable == HEST_NOT_FOUND) >> return -ENODEV; >> >> - if (hest_disable) { >> + if (hest_disable == HEST_DISABLED) { >> pr_info(GHES_PFX "HEST is not enabled!\n"); >> return -EINVAL; >> } > > Yap, looks good. > > Just a minor nitpick: I'd additionally group the hest_disable checking > in one switch-case, so that the code flow is obvious at a quick glance: > > if (acpi_disabled) > return -ENODEV; > > switch (hest_disable) { > case HEST_NOT_FOUND: > return -ENODEV; > case HEST_DISABLED: > pr_info(GHES_PFX "HEST is not enabled!\n"); > return -EINVAL; > default: > break; > } I've picked this change and will send out an update shortly. Thanks, Punit