All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: designware: Use IS_ENABLED()
@ 2014-06-18 15:16 Fabio Estevam
  2014-06-19  0:10 ` Jingoo Han
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Fabio Estevam @ 2014-06-18 15:16 UTC (permalink / raw)
  To: bhelgaas; +Cc: jg1.han, linux-pci, Fabio Estevam

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>
---
 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;
 }
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] PCI: designware: Use IS_ENABLED()
  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
  2 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2014-06-19  0:10 UTC (permalink / raw)
  To: 'Fabio Estevam', bhelgaas
  Cc: linux-pci, 'Fabio Estevam', 'Jingoo Han',
	'Mohit Kumar'

On Thursday, June 19, 2014 12:17 AM, Fabio Estevam wrote:
> 
> We can get rid of the 'ifdef' by using the IS_ENABLED() macro.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

(+cc Mohit Kumar)

Acked-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  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;
>  }
> --
> 1.8.3.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] PCI: designware: Use IS_ENABLED()
  2014-06-19  0:10 ` Jingoo Han
@ 2014-06-19  3:49   ` Mohit KUMAR DCG
  0 siblings, 0 replies; 8+ messages in thread
From: Mohit KUMAR DCG @ 2014-06-19  3:49 UTC (permalink / raw)
  To: Jingoo Han, 'Fabio Estevam', bhelgaas
  Cc: linux-pci, 'Fabio Estevam'

Hello Fabio,

> -----Original Message-----
> From: Jingoo Han [mailto:jg1.han@samsung.com]
> Sent: Thursday, June 19, 2014 5:41 AM
> To: 'Fabio Estevam'; bhelgaas@google.com
> Cc: linux-pci@vger.kernel.org; 'Fabio Estevam'; 'Jingoo Han'; Mohit KUMAR
> DCG
> Subject: Re: [PATCH] PCI: designware: Use IS_ENABLED()
> 
> On Thursday, June 19, 2014 12:17 AM, Fabio Estevam wrote:
> >
> > We can get rid of the 'ifdef' by using the IS_ENABLED() macro.
> >
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> 
> (+cc Mohit Kumar)
> 

- yes, looks good...

Acked-by: Mohit Kumar <mohit.kumar@st.com>

Thanks
Mohit

> Acked-by: Jingoo Han <jg1.han@samsung.com>
> 
> Best regards,
> Jingoo Han
> 
> > ---
> >  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;
> >  }
> > --
> > 1.8.3.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] PCI: designware: Use IS_ENABLED()
  2014-06-18 15:16 [PATCH] PCI: designware: Use IS_ENABLED() Fabio Estevam
  2014-06-19  0:10 ` Jingoo Han
@ 2014-07-02 22:24 ` Bjorn Helgaas
  2014-07-09  0:57 ` Stephen Rothwell
  2 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2014-07-02 22:24 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: jg1.han, linux-pci, Fabio Estevam

On Wed, Jun 18, 2014 at 12:16:53PM -0300, Fabio Estevam 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>

Applied with Jingoo and Mohit's acks to pci/host-designware for v3.17,
thanks!

> ---
>  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;
>  }
> -- 
> 1.8.3.2
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PCI: designware: Use IS_ENABLED()
  2014-06-18 15:16 [PATCH] PCI: designware: Use IS_ENABLED() Fabio Estevam
  2014-06-19  0:10 ` Jingoo Han
  2014-07-02 22:24 ` Bjorn Helgaas
@ 2014-07-09  0:57 ` Stephen Rothwell
  2014-07-09  1:34   ` Jingoo Han
  2 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2014-07-09  0:57 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, jg1.han, linux-pci, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

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?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PCI: designware: Use IS_ENABLED()
  2014-07-09  0:57 ` Stephen Rothwell
@ 2014-07-09  1:34   ` Jingoo Han
  2014-07-09  3:40     ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2014-07-09  1:34 UTC (permalink / raw)
  To: 'Stephen Rothwell', 'Fabio Estevam'
  Cc: bhelgaas, linux-pci, 'Fabio Estevam',
	'Jingoo Han', 'Mohit Kumar'

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PCI: designware: Use IS_ENABLED()
  2014-07-09  1:34   ` Jingoo Han
@ 2014-07-09  3:40     ` Bjorn Helgaas
  2014-07-09  6:04       ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2014-07-09  3:40 UTC (permalink / raw)
  To: Jingoo Han
  Cc: Stephen Rothwell, Fabio Estevam, linux-pci, Fabio Estevam, Mohit Kumar

On Tue, Jul 8, 2014 at 7:34 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> 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.

I dropped it.  Thanks for noticing this, Stephen.

Bjorn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PCI: designware: Use IS_ENABLED()
  2014-07-09  3:40     ` Bjorn Helgaas
@ 2014-07-09  6:04       ` Fabio Estevam
  0 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2014-07-09  6:04 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jingoo Han, Stephen Rothwell, linux-pci, Fabio Estevam, Mohit Kumar

On Wed, Jul 9, 2014 at 12:40 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:

> I dropped it.  Thanks for noticing this, Stephen.

Sorry for the trouble!

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-09  6:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2014-07-09  3:40     ` Bjorn Helgaas
2014-07-09  6:04       ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.