All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Mark Brown <broonie@kernel.org>
Cc: liam.r.girdwood@linux.intel.com,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] ASoC: rt5640: ifdef for ACPI module table
Date: Wed, 18 Sep 2013 09:53:34 -0700	[thread overview]
Message-ID: <20130918165334.GA26446@quad.lixom.net> (raw)
In-Reply-To: <20130918153842.GA21013@sirena.org.uk>

On Wed, Sep 18, 2013 at 04:38:42PM +0100, Mark Brown wrote:
> On Wed, Sep 18, 2013 at 08:13:14AM -0700, Olof Johansson wrote:
> > On Wed, Sep 18, 2013 at 2:41 AM, Mark Brown <broonie@kernel.org> wrote:
> > > On Tue, Sep 17, 2013 at 11:10:24PM -0700, Olof Johansson wrote:
> 
> > > Please send things to the advertised maintainer addresses.
> 
> > I sent it to the person signing off on the patch that this fixes up,
> > you should probably use your maintainer address for that.
> 
> In that case you should've also CCed the maintainer address, you should
> always CC maintainers on patches.

Sure, will do. But you should also consider using your maintainer address
for your maintainer work. Linaro will surely be credited for it anyway
in the oh-so-important statistics. :-)

> > > Shouldn't the fix for this be to do the same as we're doing for the OF
> > > tables and have an acpi_match_ptr()?  It seems like we're doing the same
> > > thing so we should be handling it in a similar fashion.
> 
> > There's already ACPI_PTR(), which is exactly why this warning shows
> > up. of_match_ptr() and ACPI_PTR() will evaluate to NULL if
> > CONFIG_OF/ACPI aren't set, which is the case here -- which in turn is
> > why there's a warning that the match table is defined but never used.
> 
> > So, the solution is either to not define the table, i.e. ifdef, or to
> > not use the ACPI_PTR() macro. It makes sense to not advertise the
> > driver as capable of probing on ACPI if ACPI is not enabled in the
> > kernel config, which in turn means ifdef.
> 
> > Unless I'm missing something here, of course. :)
> 
> We're supposed to be able to do this sort of stuff without the ifdef
> noise and have the compiler eliminate unreferenced static symbols
> automatically, though I can't see how of_match_ptr() actually does this
> now.  I don't immedately seem to be able to persuade Kconfig to turn
> off OF to verify though we do have some examples which nobody has
> complained about...

The problem doesn't show up when you build the driver as a module, because by
then the MODULE_DEVICE_TABLE() reference means the table is referenced. But
when you don't build as a module, MODULE_GENERIC_TABLE() reduces down to
nothing, thus causing this.

Only way to avoid is as I see it is to mark the table __maybe_unused,
which in this case doesn't look like much of a better option.

Most other drivers, for example those using pci or of module tables, have
Kconfig dependencies such that there's no need to ifdef. There are plenty of
examples of drivers ifdeffing on CONFIG_OF for those tables though.


-Olof

  reply	other threads:[~2013-09-18 16:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18  6:10 [PATCH] ASoC: rt5640: ifdef for ACPI module table Olof Johansson
2013-09-18  7:26 ` Jarkko Nikula
2013-09-18 15:10   ` Olof Johansson
2013-09-18  9:41 ` Mark Brown
2013-09-18 15:13   ` Olof Johansson
2013-09-18 15:38     ` Mark Brown
2013-09-18 16:53       ` Olof Johansson [this message]
2013-09-18 17:28         ` Mark Brown
2013-09-18 17:36           ` Olof Johansson
2013-09-18 18:34             ` Mark Brown
2013-09-18 18:44               ` Olof Johansson
2013-09-19 12:02                 ` 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=20130918165334.GA26446@quad.lixom.net \
    --to=olof@lixom.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.