From: Matthias Kaehlcke <mka@chromium.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable
Date: Thu, 6 Jul 2017 09:42:38 -0700 [thread overview]
Message-ID: <20170706164238.GB95735@google.com> (raw)
In-Reply-To: <20170701131112.7dbfa118@kernel.org>
El Sat, Jul 01, 2017 at 01:11:12PM +0100 Jonathan Cameron ha dit:
> On Thu, 29 Jun 2017 14:51:56 +0200
> Linus Walleij <linus.walleij@linaro.org> wrote:
>
> > On Tue, Jun 27, 2017 at 2:25 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> >
> > > Don't inflate the kernel size with data that isn't used. The conditional
> > > declaration also fixes the following warning when building with clang:
> > >
> > > drivers/iio/magnetometer/ak8975.c:704:36: error: variable 'ak_acpi_match'
> > > is not needed and will not be emitted
> > > [-Werror,-Wunneeded-internal-declaration]
> > >
> > > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> >
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> >
> > Yours,
> > Linus Walleij
> Applied to the togreg branch of iio.git and pushed out as testing
> for the autobuilders to play with it.
Thanks!
> I'm curious though... Can the compiler not optimize this away?
> I'd always assumed the main reason for these warnings was that the
> presence of unused data might represent a bug rather than it actually
> making any difference to the size...
clang actually optimizes it away: "variable 'ak_acpi_match' is not
needed and will not be emitted", my argument about inflating the
kernel size is not valid.
prev parent reply other threads:[~2017-07-06 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 0:25 [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable Matthias Kaehlcke
2017-06-29 12:51 ` Linus Walleij
2017-07-01 12:11 ` Jonathan Cameron
2017-07-06 16:42 ` Matthias Kaehlcke [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=20170706164238.GB95735@google.com \
--to=mka@chromium.org \
--cc=dianders@chromium.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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