public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: rt5640: Omit ACPI match table only if !ACPI
Date: Thu, 19 Sep 2013 13:21:04 +0200	[thread overview]
Message-ID: <20130919112104.GB10852@ulmo> (raw)
In-Reply-To: <20130919104525.GJ21013@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]

On Thu, Sep 19, 2013 at 11:45:25AM +0100, Mark Brown wrote:
> On Thu, Sep 19, 2013 at 11:18:06AM +0200, Thierry Reding wrote:
> > The ACPI_PTR() macro evaluates to NULL if ACPI is disabled and hence the
> > ACPI match table won't be used, causing the compiler to complain. Avoid
> > this by protecting the table using an #ifdef CONFIG_ACPI.
> 
> Applied, thanks.  Like I was saying to Olof we really should be able to
> do better than needing the ifdefs though.

The struct device_driver's .acpi_match_table field is unconditionally
declared and the ACPI table with one entry and the sentinel weighs in
at 26 bytes, so perhaps doing away with the conditionals would be an
equally good option.

Or perhaps we can annotate the table so that the compiler will stop
complaining but remove the table nonetheless if it isn't used. Similarly
to what we can do with

	if (IS_ENABLED(CONFIG_FOO)) {
		...
	}

constructs. I can't really think of a way to do that, though. Perhaps
gcc will throw away the table anyway, so we'll just need a way to make
it shut up?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-09-19 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19  9:18 [PATCH] ASoC: rt5640: Omit ACPI match table only if !ACPI Thierry Reding
2013-09-19 10:45 ` Mark Brown
2013-09-19 11:21   ` Thierry Reding [this message]
2013-09-19 13:22     ` Mark Brown

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=20130919112104.GB10852@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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