From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbbJBJpS (ORCPT ); Fri, 2 Oct 2015 05:45:18 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:53977 "EHLO mx0a-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbbJBJpQ (ORCPT ); Fri, 2 Oct 2015 05:45:16 -0400 Date: Fri, 2 Oct 2015 10:23:12 +0100 From: Charles Keepax To: Lee Jones CC: Richard Fitzgerald , , , Subject: Re: [PATCH 5/6 RESEND] mfd: arizona: Remove use of codec build config #ifdefs Message-ID: <20151002092312.GM5432@ck-lbox> References: <1443444406-30518-1-git-send-email-rf@opensource.wolfsonmicro.com> <1443444406-30518-6-git-send-email-rf@opensource.wolfsonmicro.com> <20151001114452.GP3214@x1> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151001114452.GP3214@x1> User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-10-02_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1510020132 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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