From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: rafael@kernel.org, linux-acpi@vger.kernel.org,
robert.moore@intel.com, pierre-louis.bossart@linux.intel.com,
amadeuszx.slawinski@linux.intel.com
Subject: Re: [PATCH v2 2/4] ACPI: NHLT: Introduce acpi_gbl_NHLT
Date: Wed, 19 Jul 2023 18:36:44 +0300 [thread overview]
Message-ID: <ZLgDDB7vH/4FaI06@smile.fi.intel.com> (raw)
In-Reply-To: <4af468ff-6b87-962d-8629-52bb7d9ee340@intel.com>
On Wed, Jul 19, 2023 at 04:47:31PM +0200, Cezary Rojewski wrote:
> On 2023-07-17 5:00 PM, Cezary Rojewski wrote:
...
> > +++ b/drivers/acpi/nhlt.c
> > @@ -0,0 +1,13 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +//
> > +// Copyright(c) 2023 Intel Corporation. All rights reserved.
> > +//
> > +// Authors: Cezary Rojewski <cezary.rojewski@intel.com>
> > +// Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
> > +//
> > +
> > +#include <linux/export.h>
> > +#include <acpi/nhlt.h>
> > +
> > +struct acpi_table_nhlt *acpi_gbl_NHLT;
> > +EXPORT_SYMBOL_GPL(acpi_gbl_NHLT);
>
> This approach generates a problem with undefined symbol "acpi_gbl_NHLT" when
> ACPI_NHLT is disabled. As nhlt.c is not built when said kconfig is disabled,
> symbol is never defined.
>
> Proposed solution - modify drivers/acpi/tables.c with:
>
> +#include <acpi/nhlt.h>
> +
> +struct acpi_table_nhlt *acpi_gbl_NHLT;
> +EXPORT_SYMBOL_GPL(acpi_gbl_NHLT);
>
> as tables.c is always built the symbol is always there.
> The only other option I see is:
>
> -obj-$(CONFIG_ACPI_NHLT) += nhlt.o
> +obj-y += nhlt.o
>
> and modifying nhlt.c so it's essentially split in half with:
> #if IS_ENABLED(CONFIG_ACPI_NHLT)
>
> but such solutions stinks. I prefer the first approach.
> What to you find guys?
I leave this to Rafael as it's his territory.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-07-19 15:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 15:00 [PATCH v2 0/4] ACPI: NHLT: Access and query helpers Cezary Rojewski
2023-07-17 15:00 ` [PATCH v2 1/4] ACPI: NHLT: Device configuration access interface Cezary Rojewski
2023-07-17 15:00 ` [PATCH v2 2/4] ACPI: NHLT: Introduce acpi_gbl_NHLT Cezary Rojewski
2023-07-19 14:47 ` Cezary Rojewski
2023-07-19 15:36 ` Andy Shevchenko [this message]
2023-07-20 9:15 ` Cezary Rojewski
2023-07-20 17:01 ` Rafael J. Wysocki
2023-07-20 17:05 ` Rafael J. Wysocki
2023-07-21 9:49 ` Cezary Rojewski
2023-07-21 9:51 ` Rafael J. Wysocki
2023-07-17 15:00 ` [PATCH v2 3/4] ACPI: NHLT: Table manipulation helpers Cezary Rojewski
2023-07-17 15:00 ` [PATCH v2 4/4] ACPI: NHLT: Add query functions Cezary Rojewski
2023-07-17 15:13 ` Andy Shevchenko
2023-07-19 14:56 ` [PATCH v2 0/4] ACPI: NHLT: Access and query helpers Cezary Rojewski
2023-07-19 15:59 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZLgDDB7vH/4FaI06@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=cezary.rojewski@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox