Hi Fabio, [I noticed this in the pci tree in linux-next this morning] On Wed, 18 Jun 2014 12:16:53 -0300 Fabio Estevam <festevam@xxxxxxxxx> wrote: > > From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx> > > We can get rid of the 'ifdef' by using the IS_ENABLED() macro. > > Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx> > Acked-by: Jingoo Han <jg1.han@xxxxxxxxxxx> > Acked-by: Mohit Kumar <mohit.kumar@xxxxxx> > > --- > drivers/pci/host/pcie-designware.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c > index 1eaf4df3..dc842fd 100644 > --- a/drivers/pci/host/pcie-designware.c > +++ b/drivers/pci/host/pcie-designware.c > @@ -497,9 +497,8 @@ int __init dw_pcie_host_init(struct pcie_port *pp) > > pci_common_init_dev(pp->dev, &dw_pci); > pci_assign_unassigned_resources(); > -#ifdef CONFIG_PCI_DOMAINS > - dw_pci.domain++; > -#endif > + if (IS_ENABLED(CONFIG_PCI_DOMAINS)) > + dw_pci.domain++; > > return 0; > } Will this actually compile if CONFIG_PCI_DOMAINS is disabled, since the "domains" field of dw_pci does not even exist in that case (it is ifdeffed out in arch/arm/include/asm/mach/pci.h)? Even if it works with newer compilers, will it work with older ones i.e. how new does the compiler have to be to elide the code before noticing that "domains" does not exist? -- Cheers, Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
Attachment:
signature.asc
Description: PGP signature