[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6O9kVCDqiKwQcYi@gourry-fedora-PF4VCD3F>
Date: Wed, 5 Feb 2025 14:35:45 -0500
From: Gregory Price <gourry@...rry.net>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>,
linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-cxl@...r.kernel.org, Ard Biesheuvel <ardb@...nel.org>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Ira Weiny <ira.weiny@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Yazen Ghannam <yazen.ghannam@....com>,
Terry Bowman <terry.bowman@....com>
Subject: Re: [PATCH v6 4/6] acpi/ghes, cper: Recognize and cache CXL Protocol
errors
On Mon, Feb 03, 2025 at 10:59:14AM -0800, Luck, Tony wrote:
> On Thu, Jan 23, 2025 at 08:44:19AM +0000, Smita Koralahalli wrote:
> > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> > index b72772494655..4d725d988c43 100644
> > --- a/drivers/acpi/apei/ghes.c
> > +++ b/drivers/acpi/apei/ghes.c
> > @@ -674,6 +674,56 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
> > schedule_work(&entry->work);
> > }
> >
> > +static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,
> > + int severity)
> > +{
> > +#ifdef CONFIG_ACPI_APEI_PCIEAER
>
> #ifdef in ".c" code is ugly. But I don't see a less ugly way to deal
> with this. Moving this elsewhere and adding an empty stub function
> for when CONFIG_ACPI_APEI_PCIEAER isn't configured doesn't make things
> any better.
>
The generally accepted ways I've seen for static funcs in .c is:
#ifdef CONFIG_ACPI_APEI_PCIEAER
static void ghes_handle_aer(struct acpi_hest_generic_data *gdata)
{
...
}
#else
static void ghes_handle_aer(struct acpi_hest_generic_data *gdata) { }
#endif
This at least makes the function that does stuff easier to read and
gives you a spot to throw out a "Config not enabled" error if its
beneficial.
More of a style nit than anything else.
But either way,
Reviewed-by: Gregory Price <gourry@...rry.net>
Powered by blists - more mailing lists