From: Jingoo Han <jg1.han@samsung.com>
To: 'Stephen Rothwell' <sfr@canb.auug.org.au>,
'Fabio Estevam' <festevam@gmail.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
'Fabio Estevam' <fabio.estevam@freescale.com>,
'Jingoo Han' <jg1.han@samsung.com>,
'Mohit Kumar' <mohit.kumar@st.com>
Subject: Re: PCI: designware: Use IS_ENABLED()
Date: Wed, 09 Jul 2014 10:34:05 +0900 [thread overview]
Message-ID: <001101cf9b15$df01cf50$9d056df0$%han@samsung.com> (raw)
In-Reply-To: <20140709105731.1b3e2bbe@canb.auug.org.au>
On Wednesday, July 09, 2014 9:58 AM, Stephen Rothwell wrote:
>
> 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@gmail.com> wrote:
> >
> > From: Fabio Estevam <fabio.estevam@freescale.com>
> >
> > We can get rid of the 'ifdef' by using the IS_ENABLED() macro.
> >
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > Acked-by: Jingoo Han <jg1.han@samsung.com>
> > Acked-by: Mohit Kumar <mohit.kumar@st.com>
> >
> > ---
> > 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?
Oops, you're right! It makes build errors when CONFIG_PCI_DOMAINS
is disabled.
The "domain" variable is guarded by "#ifdef CONFIG_PCI_DOMAINS";
thus, IS_ENABLED() should NOT be used.
./arch/arm/include/asm/mach/pci.h
struct hw_pci {
#ifdef CONFIG_PCI_DOMAINS
int domain;
#endif
Bjorn Helgaas,
Please revert this patch from your pci tree. Thank you.
Best regards,
Jingoo Han
>
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
next prev parent reply other threads:[~2014-07-09 1:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 15:16 [PATCH] PCI: designware: Use IS_ENABLED() Fabio Estevam
2014-06-19 0:10 ` Jingoo Han
2014-06-19 3:49 ` Mohit KUMAR DCG
2014-07-02 22:24 ` Bjorn Helgaas
2014-07-09 0:57 ` Stephen Rothwell
2014-07-09 1:34 ` Jingoo Han [this message]
2014-07-09 3:40 ` Bjorn Helgaas
2014-07-09 6:04 ` Fabio Estevam
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='001101cf9b15$df01cf50$9d056df0$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=bhelgaas@google.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=mohit.kumar@st.com \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).