public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
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 4/4] ACPI: NHLT: Add query functions
Date: Tue, 18 Jul 2023 17:17:25 +0300	[thread overview]
Message-ID: <ZLae9VTcJaVcjwSJ@smile.fi.intel.com> (raw)
In-Reply-To: <395ada91-9560-c001-c1e1-4b441ac9b7cc@intel.com>

On Tue, Jul 18, 2023 at 01:11:03PM +0200, Cezary Rojewski wrote:
> On 2023-07-17 11:47 AM, Andy Shevchenko wrote:
> > On Mon, Jul 17, 2023 at 10:29:17AM +0200, Cezary Rojewski wrote:

...

> > I prefer to get rid of those.
> 
> Decided to do some manual tests on more exotic setups that are not part of
> our daily CI/CD routine and, completely getting rid of those ifs causes
> problems. Those setups are part of the market, expose DSP capabilities but
> have invalid BIOS configurations.
> 
> Rather than just bringing back the if-statement, different solution came to
> my mind:
> 
> static struct acpi_table_nhlt empty_nhlt = {
> 	.header = {
> 		.signature = ACPI_SIG_NHLT,
> 	},
> };
> 
> struct acpi_table_nhlt *acpi_gbl_NHLT;
> EXPORT_SYMBOL_GPL(acpi_gbl_NHLT);
> 
> acpi_status acpi_nhlt_get_gbl_table(void)
> {
> 	acpi_status status;
> 
> 	status = acpi_get_table(ACPI_SIG_NHLT, 0, (struct acpi_table_header
> **)(&acpi_gbl_NHLT));
> 	if (!acpi_gbl_NHLT)
> 		acpi_gbl_NHLT = &empty_nhlt;
> 	return status;
> }
> EXPORT_SYMBOL_GPL(acpi_nhlt_get_gbl_table);
> 
> What do you think?

I think it's wonderful what you found and I dunno how I missed this.
Go for this, definitely!

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2023-07-18 14:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  9:10 [PATCH 0/4] ACPI: NHLT: Access and query helpers Cezary Rojewski
2023-07-12  9:10 ` [PATCH 1/4] ACPI: NHLT: Device configuration access interface Cezary Rojewski
2023-07-12  9:10 ` [PATCH 2/4] ACPI: NHLT: Introduce acpi_gbl_NHLT Cezary Rojewski
2023-07-12  9:10 ` [PATCH 3/4] ACPI: NHLT: Table manipulation helpers Cezary Rojewski
2023-07-12 15:36   ` Andy Shevchenko
2023-07-17  8:08     ` Cezary Rojewski
2023-07-12  9:10 ` [PATCH 4/4] ACPI: NHLT: Add query functions Cezary Rojewski
2023-07-12 15:48   ` Andy Shevchenko
2023-07-17  8:29     ` Cezary Rojewski
2023-07-17  9:47       ` Andy Shevchenko
2023-07-17 11:25         ` Cezary Rojewski
2023-07-18 11:11         ` Cezary Rojewski
2023-07-18 14:17           ` Andy Shevchenko [this message]

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=ZLae9VTcJaVcjwSJ@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