lkml.org 
[lkml]   [2017]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable
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.

\
 
 \ /
  Last update: 2017-07-06 18:43    [W:0.043 / U:0.072 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site