diff mbox

[v3,1/6] spapr_pci: remove duplicate macros

Message ID 1430816036-26408-2-git-send-email-nikunj@linux.vnet.ibm.com
State New
Headers show

Commit Message

Nikunj A Dadhania May 5, 2015, 8:53 a.m. UTC
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
 hw/ppc/spapr_pci.c | 11 -----------
 1 file changed, 11 deletions(-)

Comments

Thomas Huth May 5, 2015, 1:53 p.m. UTC | #1
On Tue,  5 May 2015 14:23:51 +0530
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> wrote:

> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
> ---
>  hw/ppc/spapr_pci.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 2e7590c..4df3a33 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1475,17 +1475,6 @@ PCIHostState *spapr_create_phb(sPAPREnvironment *spapr, int index)
>      return PCI_HOST_BRIDGE(dev);
>  }
>  
> -/* Macros to operate with address in OF binding to PCI */
> -#define b_x(x, p, l)    (((x) & ((1<<(l))-1)) << (p))
> -#define b_n(x)          b_x((x), 31, 1) /* 0 if relocatable */
> -#define b_p(x)          b_x((x), 30, 1) /* 1 if prefetchable */
> -#define b_t(x)          b_x((x), 29, 1) /* 1 if the address is aliased */
> -#define b_ss(x)         b_x((x), 24, 2) /* the space code */
> -#define b_bbbbbbbb(x)   b_x((x), 16, 8) /* bus number */
> -#define b_ddddd(x)      b_x((x), 11, 5) /* device number */
> -#define b_fff(x)        b_x((x), 8, 3)  /* function number */
> -#define b_rrrrrrrr(x)   b_x((x), 0, 8)  /* register number */

Seems like the duplication is not in master yet, only in spapr-next,
and has apparently been introduced by commit 2c938a6692c01818e 
(spapr_pci: enable basic hotplug operations) ...
So an alternative would be to fix up that patch instead. David?

Anyway, the duplication should go away, so:

Reviewed-by: Thomas Huth <thuth@redhat.com>
Nikunj A Dadhania May 6, 2015, 5:41 a.m. UTC | #2
Thomas Huth <thuth@redhat.com> writes:

> On Tue,  5 May 2015 14:23:51 +0530
> Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> wrote:
>
>> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
>> ---
>>  hw/ppc/spapr_pci.c | 11 -----------
>>  1 file changed, 11 deletions(-)
>> 
>> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
>> index 2e7590c..4df3a33 100644
>> --- a/hw/ppc/spapr_pci.c
>> +++ b/hw/ppc/spapr_pci.c
>> @@ -1475,17 +1475,6 @@ PCIHostState *spapr_create_phb(sPAPREnvironment *spapr, int index)
>>      return PCI_HOST_BRIDGE(dev);
>>  }
>>  
>> -/* Macros to operate with address in OF binding to PCI */
>> -#define b_x(x, p, l)    (((x) & ((1<<(l))-1)) << (p))
>> -#define b_n(x)          b_x((x), 31, 1) /* 0 if relocatable */
>> -#define b_p(x)          b_x((x), 30, 1) /* 1 if prefetchable */
>> -#define b_t(x)          b_x((x), 29, 1) /* 1 if the address is aliased */
>> -#define b_ss(x)         b_x((x), 24, 2) /* the space code */
>> -#define b_bbbbbbbb(x)   b_x((x), 16, 8) /* bus number */
>> -#define b_ddddd(x)      b_x((x), 11, 5) /* device number */
>> -#define b_fff(x)        b_x((x), 8, 3)  /* function number */
>> -#define b_rrrrrrrr(x)   b_x((x), 0, 8)  /* register number */
>
> Seems like the duplication is not in master yet, only in spapr-next,
> and has apparently been introduced by commit 2c938a6692c01818e 
> (spapr_pci: enable basic hotplug operations) ...
> So an alternative would be to fix up that patch instead. David?

Yes, that would be fine with me as well.

> Anyway, the duplication should go away, so:
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Regards
Nikunj
David Gibson May 7, 2015, 12:55 a.m. UTC | #3
On Wed, May 06, 2015 at 11:11:05AM +0530, Nikunj A Dadhania wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
> > On Tue,  5 May 2015 14:23:51 +0530
> > Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> wrote:
> >
> >> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
> >> ---
> >>  hw/ppc/spapr_pci.c | 11 -----------
> >>  1 file changed, 11 deletions(-)
> >> 
> >> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> >> index 2e7590c..4df3a33 100644
> >> --- a/hw/ppc/spapr_pci.c
> >> +++ b/hw/ppc/spapr_pci.c
> >> @@ -1475,17 +1475,6 @@ PCIHostState *spapr_create_phb(sPAPREnvironment *spapr, int index)
> >>      return PCI_HOST_BRIDGE(dev);
> >>  }
> >>  
> >> -/* Macros to operate with address in OF binding to PCI */
> >> -#define b_x(x, p, l)    (((x) & ((1<<(l))-1)) << (p))
> >> -#define b_n(x)          b_x((x), 31, 1) /* 0 if relocatable */
> >> -#define b_p(x)          b_x((x), 30, 1) /* 1 if prefetchable */
> >> -#define b_t(x)          b_x((x), 29, 1) /* 1 if the address is aliased */
> >> -#define b_ss(x)         b_x((x), 24, 2) /* the space code */
> >> -#define b_bbbbbbbb(x)   b_x((x), 16, 8) /* bus number */
> >> -#define b_ddddd(x)      b_x((x), 11, 5) /* device number */
> >> -#define b_fff(x)        b_x((x), 8, 3)  /* function number */
> >> -#define b_rrrrrrrr(x)   b_x((x), 0, 8)  /* register number */
> >
> > Seems like the duplication is not in master yet, only in spapr-next,
> > and has apparently been introduced by commit 2c938a6692c01818e 
> > (spapr_pci: enable basic hotplug operations) ...
> > So an alternative would be to fix up that patch instead. David?
> 
> Yes, that would be fine with me as well.

I've amended the patch in spapr-next.

> 
> > Anyway, the duplication should go away, so:
> >
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> Regards
> Nikunj
>
Nikunj A Dadhania May 7, 2015, 4:55 a.m. UTC | #4
David Gibson <david@gibson.dropbear.id.au> writes:

> On Wed, May 06, 2015 at 11:11:05AM +0530, Nikunj A Dadhania wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>> 
>> > On Tue,  5 May 2015 14:23:51 +0530
>> > Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> wrote:
>> >
>> >> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
>> >> ---
>> >>  hw/ppc/spapr_pci.c | 11 -----------
>> >>  1 file changed, 11 deletions(-)
>> >> 
>> >> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
>> >> index 2e7590c..4df3a33 100644
>> >> --- a/hw/ppc/spapr_pci.c
>> >> +++ b/hw/ppc/spapr_pci.c
>> >> @@ -1475,17 +1475,6 @@ PCIHostState *spapr_create_phb(sPAPREnvironment *spapr, int index)
>> >>      return PCI_HOST_BRIDGE(dev);
>> >>  }
>> >>  
>> >> -/* Macros to operate with address in OF binding to PCI */
>> >> -#define b_x(x, p, l)    (((x) & ((1<<(l))-1)) << (p))
>> >> -#define b_n(x)          b_x((x), 31, 1) /* 0 if relocatable */
>> >> -#define b_p(x)          b_x((x), 30, 1) /* 1 if prefetchable */
>> >> -#define b_t(x)          b_x((x), 29, 1) /* 1 if the address is aliased */
>> >> -#define b_ss(x)         b_x((x), 24, 2) /* the space code */
>> >> -#define b_bbbbbbbb(x)   b_x((x), 16, 8) /* bus number */
>> >> -#define b_ddddd(x)      b_x((x), 11, 5) /* device number */
>> >> -#define b_fff(x)        b_x((x), 8, 3)  /* function number */
>> >> -#define b_rrrrrrrr(x)   b_x((x), 0, 8)  /* register number */
>> >
>> > Seems like the duplication is not in master yet, only in spapr-next,
>> > and has apparently been introduced by commit 2c938a6692c01818e 
>> > (spapr_pci: enable basic hotplug operations) ...
>> > So an alternative would be to fix up that patch instead. David?
>> 
>> Yes, that would be fine with me as well.
>
> I've amended the patch in spapr-next.

Great, I will rebase and drop this patch.
>
>> 
>> > Anyway, the duplication should go away, so:
>> >
>> > Reviewed-by: Thomas Huth <thuth@redhat.com>
>> 
>> Regards
>> Nikunj
>> 
>
> -- 
> David Gibson			| I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
> 				| _way_ _around_!
> http://www.ozlabs.org/~dgibson
diff mbox

Patch

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 2e7590c..4df3a33 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1475,17 +1475,6 @@  PCIHostState *spapr_create_phb(sPAPREnvironment *spapr, int index)
     return PCI_HOST_BRIDGE(dev);
 }
 
-/* Macros to operate with address in OF binding to PCI */
-#define b_x(x, p, l)    (((x) & ((1<<(l))-1)) << (p))
-#define b_n(x)          b_x((x), 31, 1) /* 0 if relocatable */
-#define b_p(x)          b_x((x), 30, 1) /* 1 if prefetchable */
-#define b_t(x)          b_x((x), 29, 1) /* 1 if the address is aliased */
-#define b_ss(x)         b_x((x), 24, 2) /* the space code */
-#define b_bbbbbbbb(x)   b_x((x), 16, 8) /* bus number */
-#define b_ddddd(x)      b_x((x), 11, 5) /* device number */
-#define b_fff(x)        b_x((x), 8, 3)  /* function number */
-#define b_rrrrrrrr(x)   b_x((x), 0, 8)  /* register number */
-
 int spapr_populate_pci_dt(sPAPRPHBState *phb,
                           uint32_t xics_phandle,
                           void *fdt)