[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151002092312.GM5432@ck-lbox>
Date: Fri, 2 Oct 2015 10:23:12 +0100
From: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
To: Lee Jones <lee.jones@...aro.org>
CC: Richard Fitzgerald <rf@...nsource.wolfsonmicro.com>,
<sameo@...ux.intel.com>, <patches@...nsource.wolfsonmicro.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/6 RESEND] mfd: arizona: Remove use of codec build
config #ifdefs
On Thu, Oct 01, 2015 at 12:44:52PM +0100, Lee Jones wrote:
> On Mon, 28 Sep 2015, Richard Fitzgerald wrote:
>
> > Remove the use of #ifdefs around each case statement of the chip ID
> > and type validation switches.
> >
> > We must ensure that the contained code still compiles to nothing if
> > support for that codec was not built into the kernel, to prevent
> > creation of link references to missing functions. So the ifdefs are
> > replaced with a use of the IS_ENABLED() macro.
> >
> > Signed-off-by: Richard Fitzgerald <rf@...nsource.wolfsonmicro.com>
> > ---
> > drivers/mfd/arizona-core.c | 29 +++++++++++++++++++++--------
> > drivers/mfd/arizona-i2c.c | 28 +++++++++++++++-------------
> > drivers/mfd/arizona-spi.c | 18 +++++++++++-------
> > 3 files changed, 47 insertions(+), 28 deletions(-)
> >
> > diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
> > index 2512192..cc2117e 100644
> > --- a/drivers/mfd/arizona-core.c
> > +++ b/drivers/mfd/arizona-core.c
> > @@ -1130,22 +1130,26 @@ int arizona_dev_init(struct arizona *arizona)
> > arizona->rev &= ARIZONA_DEVICE_REVISION_MASK;
> >
> > switch (reg) {
> > -#ifdef CONFIG_MFD_WM5102
> > case 0x5102:
> > + if (!IS_ENABLED(CONFIG_MFD_WM5102))
> > + break;
> > +
>
> Are you sure this statement effects the code below?
>
> I'm not sure it will. How have you tested it?
Yeah looking at that again I am not sure that is going to cause
that code to be elimated either. Richard is on holiday this week
and next. I will try to find time to have a look at this today.
Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists