diff mbox

[1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal

Message ID 1392297243-61848-1-git-send-email-wangyijing@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yijing Wang Feb. 13, 2014, 1:13 p.m. UTC
Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Rafael J. Wysocki Feb. 13, 2014, 11:54 p.m. UTC | #1
On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Looks reasonable to me.

Does it conflict with anything currently in linux-next (the linux-next branch
of linux-pm.git in particular)?

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index cd929ae..aee6a0a 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>   */
>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  {
> -	struct list_head *tmp;
> +	struct pci_bus *tmp;
>  	unsigned char max, n;
>  
>  	/*
> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  	 */
>  	max = bus->busn_res.start;
>  
> -	list_for_each(tmp, &bus->children) {
> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> +	list_for_each_entry(tmp, &bus->children, node) {
> +		n = pci_bus_max_busnr(tmp);
>  		if (n > max)
>  			max = n;
>  	}
>
Yijing Wang Feb. 14, 2014, 2:19 a.m. UTC | #2
On 2014/2/14 7:54, Rafael J. Wysocki wrote:
> On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
>> Replace list_for_each() + pci_bus_b() with the simpler
>> list_for_each_entry().
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> Looks reasonable to me.
> 
> Does it conflict with anything currently in linux-next (the linux-next branch
> of linux-pm.git in particular)?

Hi Rafael,
   I applied this to your linux-next branch successfully . No conflicts found.

Thanks!
Yijing.

> 
>> ---
>>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index cd929ae..aee6a0a 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>>   */
>>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  {
>> -	struct list_head *tmp;
>> +	struct pci_bus *tmp;
>>  	unsigned char max, n;
>>  
>>  	/*
>> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  	 */
>>  	max = bus->busn_res.start;
>>  
>> -	list_for_each(tmp, &bus->children) {
>> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
>> +	list_for_each_entry(tmp, &bus->children, node) {
>> +		n = pci_bus_max_busnr(tmp);
>>  		if (n > max)
>>  			max = n;
>>  	}
>>
>
Rafael J. Wysocki Feb. 14, 2014, 1:39 p.m. UTC | #3
On Friday, February 14, 2014 10:19:41 AM Yijing Wang wrote:
> On 2014/2/14 7:54, Rafael J. Wysocki wrote:
> > On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
> >> Replace list_for_each() + pci_bus_b() with the simpler
> >> list_for_each_entry().
> >>
> >> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> > 
> > Looks reasonable to me.
> > 
> > Does it conflict with anything currently in linux-next (the linux-next branch
> > of linux-pm.git in particular)?
> 
> Hi Rafael,
>    I applied this to your linux-next branch successfully . No conflicts found.

Good. :-)

Please feel free to add my ACK to it.

Rafael


> >> ---
> >>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
> >>  1 files changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> >> index cd929ae..aee6a0a 100644
> >> --- a/drivers/pci/hotplug/acpiphp_glue.c
> >> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> >> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
> >>   */
> >>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
> >>  {
> >> -	struct list_head *tmp;
> >> +	struct pci_bus *tmp;
> >>  	unsigned char max, n;
> >>  
> >>  	/*
> >> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
> >>  	 */
> >>  	max = bus->busn_res.start;
> >>  
> >> -	list_for_each(tmp, &bus->children) {
> >> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> >> +	list_for_each_entry(tmp, &bus->children, node) {
> >> +		n = pci_bus_max_busnr(tmp);
> >>  		if (n > max)
> >>  			max = n;
> >>  	}
> >>
> > 
> 
> 
>
Bjorn Helgaas Feb. 14, 2014, 6:23 p.m. UTC | #4
On Thu, Feb 13, 2014 at 09:13:58PM +0800, Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

I applied all six of these (please include a 0/6 cover letter in the
future; that's a nice place to note that I applied things) to
pci/list-for-each-entry for v3.15, thanks!

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index cd929ae..aee6a0a 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>   */
>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  {
> -	struct list_head *tmp;
> +	struct pci_bus *tmp;
>  	unsigned char max, n;
>  
>  	/*
> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  	 */
>  	max = bus->busn_res.start;
>  
> -	list_for_each(tmp, &bus->children) {
> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> +	list_for_each_entry(tmp, &bus->children, node) {
> +		n = pci_bus_max_busnr(tmp);
>  		if (n > max)
>  			max = n;
>  	}
> -- 
> 1.7.1
> 
>
Yijing Wang Feb. 15, 2014, 12:49 a.m. UTC | #5
>>> Does it conflict with anything currently in linux-next (the linux-next branch
>>> of linux-pm.git in particular)?
>>
>> Hi Rafael,
>>    I applied this to your linux-next branch successfully . No conflicts found.
> 
> Good. :-)
> 
> Please feel free to add my ACK to it.

Thanks very much!
Yijing Wang Feb. 15, 2014, 12:52 a.m. UTC | #6
On 2014/2/15 2:23, Bjorn Helgaas wrote:
> On Thu, Feb 13, 2014 at 09:13:58PM +0800, Yijing Wang wrote:
>> Replace list_for_each() + pci_bus_b() with the simpler
>> list_for_each_entry().
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> I applied all six of these (please include a 0/6 cover letter in the
> future; that's a nice place to note that I applied things) to
> pci/list-for-each-entry for v3.15, thanks!

Thanks, I will add cover letter in the next time, sorry.

> 
>> ---
>>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index cd929ae..aee6a0a 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>>   */
>>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  {
>> -	struct list_head *tmp;
>> +	struct pci_bus *tmp;
>>  	unsigned char max, n;
>>  
>>  	/*
>> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  	 */
>>  	max = bus->busn_res.start;
>>  
>> -	list_for_each(tmp, &bus->children) {
>> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
>> +	list_for_each_entry(tmp, &bus->children, node) {
>> +		n = pci_bus_max_busnr(tmp);
>>  		if (n > max)
>>  			max = n;
>>  	}
>> -- 
>> 1.7.1
>>
>>
> 
>
diff mbox

Patch

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cd929ae..aee6a0a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -450,7 +450,7 @@  static void cleanup_bridge(struct acpiphp_bridge *bridge)
  */
 static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	/*
@@ -463,8 +463,8 @@  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 	 */
 	max = bus->busn_res.start;
 
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if (n > max)
 			max = n;
 	}