Commit 2fd39aa7 authored by akpm@linux-foundation.org's avatar akpm@linux-foundation.org Committed by Jesse Barnes

PCI: ibmphp: list_for_each to list_for_each_entry-checkpatch cleanups

Please run checkpatch prior to sending patches, this one fixes several style
issues with the list_for_each conversion patch.

Cc: Cordelia Sam <cordesam@gmail.com>
Cc: Cordelia Sam <cordsam@linux.vnet.ibm.com>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent a8d2dbd3
...@@ -124,7 +124,7 @@ static void __init print_bus_info (void) ...@@ -124,7 +124,7 @@ static void __init print_bus_info (void)
{ {
struct bus_info *ptr; struct bus_info *ptr;
list_for_each_entry (ptr, &bus_info_head, bus_info_list) { list_for_each_entry(ptr, &bus_info_head, bus_info_list) {
debug ("%s - slot_min = %x\n", __func__, ptr->slot_min); debug ("%s - slot_min = %x\n", __func__, ptr->slot_min);
debug ("%s - slot_max = %x\n", __func__, ptr->slot_max); debug ("%s - slot_max = %x\n", __func__, ptr->slot_max);
debug ("%s - slot_count = %x\n", __func__, ptr->slot_count); debug ("%s - slot_count = %x\n", __func__, ptr->slot_count);
...@@ -145,7 +145,7 @@ static void print_lo_info (void) ...@@ -145,7 +145,7 @@ static void print_lo_info (void)
{ {
struct rio_detail *ptr; struct rio_detail *ptr;
debug ("print_lo_info ----\n"); debug ("print_lo_info ----\n");
list_for_each_entry (ptr, &rio_lo_head, rio_detail_list) { list_for_each_entry(ptr, &rio_lo_head, rio_detail_list) {
debug ("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id); debug ("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id);
debug ("%s - rio_type = %x\n", __func__, ptr->rio_type); debug ("%s - rio_type = %x\n", __func__, ptr->rio_type);
debug ("%s - owner_id = %x\n", __func__, ptr->owner_id); debug ("%s - owner_id = %x\n", __func__, ptr->owner_id);
...@@ -160,7 +160,7 @@ static void print_vg_info (void) ...@@ -160,7 +160,7 @@ static void print_vg_info (void)
{ {
struct rio_detail *ptr; struct rio_detail *ptr;
debug ("%s ---\n", __func__); debug ("%s ---\n", __func__);
list_for_each_entry (ptr, &rio_vg_head, rio_detail_list) { list_for_each_entry(ptr, &rio_vg_head, rio_detail_list) {
debug ("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id); debug ("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id);
debug ("%s - rio_type = %x\n", __func__, ptr->rio_type); debug ("%s - rio_type = %x\n", __func__, ptr->rio_type);
debug ("%s - owner_id = %x\n", __func__, ptr->owner_id); debug ("%s - owner_id = %x\n", __func__, ptr->owner_id);
...@@ -175,7 +175,7 @@ static void __init print_ebda_pci_rsrc (void) ...@@ -175,7 +175,7 @@ static void __init print_ebda_pci_rsrc (void)
{ {
struct ebda_pci_rsrc *ptr; struct ebda_pci_rsrc *ptr;
list_for_each_entry (ptr, &ibmphp_ebda_pci_rsrc_head, ebda_pci_rsrc_list) { list_for_each_entry(ptr, &ibmphp_ebda_pci_rsrc_head, ebda_pci_rsrc_list) {
debug ("%s - rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n", debug ("%s - rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n",
__func__, ptr->rsrc_type ,ptr->bus_num, ptr->dev_fun,ptr->start_addr, ptr->end_addr); __func__, ptr->rsrc_type ,ptr->bus_num, ptr->dev_fun,ptr->start_addr, ptr->end_addr);
} }
...@@ -185,7 +185,7 @@ static void __init print_ibm_slot (void) ...@@ -185,7 +185,7 @@ static void __init print_ibm_slot (void)
{ {
struct slot *ptr; struct slot *ptr;
list_for_each_entry (ptr, &ibmphp_slot_head, ibm_slot_list) { list_for_each_entry(ptr, &ibmphp_slot_head, ibm_slot_list) {
debug ("%s - slot_number: %x\n", __func__, ptr->number); debug ("%s - slot_number: %x\n", __func__, ptr->number);
} }
} }
...@@ -194,7 +194,7 @@ static void __init print_opt_vg (void) ...@@ -194,7 +194,7 @@ static void __init print_opt_vg (void)
{ {
struct opt_rio *ptr; struct opt_rio *ptr;
debug ("%s ---\n", __func__); debug ("%s ---\n", __func__);
list_for_each_entry (ptr, &opt_vg_head, opt_rio_list) { list_for_each_entry(ptr, &opt_vg_head, opt_rio_list) {
debug ("%s - rio_type %x\n", __func__, ptr->rio_type); debug ("%s - rio_type %x\n", __func__, ptr->rio_type);
debug ("%s - chassis_num: %x\n", __func__, ptr->chassis_num); debug ("%s - chassis_num: %x\n", __func__, ptr->chassis_num);
debug ("%s - first_slot_num: %x\n", __func__, ptr->first_slot_num); debug ("%s - first_slot_num: %x\n", __func__, ptr->first_slot_num);
...@@ -207,7 +207,7 @@ static void __init print_ebda_hpc (void) ...@@ -207,7 +207,7 @@ static void __init print_ebda_hpc (void)
struct controller *hpc_ptr; struct controller *hpc_ptr;
u16 index; u16 index;
list_for_each_entry (hpc_ptr, &ebda_hpc_head, ebda_hpc_list) { list_for_each_entry(hpc_ptr, &ebda_hpc_head, ebda_hpc_list) {
for (index = 0; index < hpc_ptr->slot_count; index++) { for (index = 0; index < hpc_ptr->slot_count; index++) {
debug ("%s - physical slot#: %x\n", __func__, hpc_ptr->slots[index].slot_num); debug ("%s - physical slot#: %x\n", __func__, hpc_ptr->slots[index].slot_num);
debug ("%s - pci bus# of the slot: %x\n", __func__, hpc_ptr->slots[index].slot_bus_num); debug ("%s - pci bus# of the slot: %x\n", __func__, hpc_ptr->slots[index].slot_bus_num);
...@@ -444,7 +444,7 @@ static int __init ebda_rio_table (void) ...@@ -444,7 +444,7 @@ static int __init ebda_rio_table (void)
static struct opt_rio *search_opt_vg (u8 chassis_num) static struct opt_rio *search_opt_vg (u8 chassis_num)
{ {
struct opt_rio *ptr; struct opt_rio *ptr;
list_for_each_entry (ptr, &opt_vg_head, opt_rio_list) { list_for_each_entry(ptr, &opt_vg_head, opt_rio_list) {
if (ptr->chassis_num == chassis_num) if (ptr->chassis_num == chassis_num)
return ptr; return ptr;
} }
...@@ -456,7 +456,7 @@ static int __init combine_wpg_for_chassis (void) ...@@ -456,7 +456,7 @@ static int __init combine_wpg_for_chassis (void)
struct opt_rio *opt_rio_ptr = NULL; struct opt_rio *opt_rio_ptr = NULL;
struct rio_detail *rio_detail_ptr = NULL; struct rio_detail *rio_detail_ptr = NULL;
list_for_each_entry (rio_detail_ptr, &rio_vg_head, rio_detail_list) { list_for_each_entry(rio_detail_ptr, &rio_vg_head, rio_detail_list) {
opt_rio_ptr = search_opt_vg (rio_detail_ptr->chassis_num); opt_rio_ptr = search_opt_vg (rio_detail_ptr->chassis_num);
if (!opt_rio_ptr) { if (!opt_rio_ptr) {
opt_rio_ptr = kzalloc(sizeof(struct opt_rio), GFP_KERNEL); opt_rio_ptr = kzalloc(sizeof(struct opt_rio), GFP_KERNEL);
...@@ -482,7 +482,7 @@ static int __init combine_wpg_for_chassis (void) ...@@ -482,7 +482,7 @@ static int __init combine_wpg_for_chassis (void)
static struct opt_rio_lo *search_opt_lo (u8 chassis_num) static struct opt_rio_lo *search_opt_lo (u8 chassis_num)
{ {
struct opt_rio_lo *ptr; struct opt_rio_lo *ptr;
list_for_each_entry (ptr, &opt_lo_head, opt_rio_lo_list) { list_for_each_entry(ptr, &opt_lo_head, opt_rio_lo_list) {
if (ptr->chassis_num == chassis_num) if (ptr->chassis_num == chassis_num)
return ptr; return ptr;
} }
...@@ -494,7 +494,7 @@ static int combine_wpg_for_expansion (void) ...@@ -494,7 +494,7 @@ static int combine_wpg_for_expansion (void)
struct opt_rio_lo *opt_rio_lo_ptr = NULL; struct opt_rio_lo *opt_rio_lo_ptr = NULL;
struct rio_detail *rio_detail_ptr = NULL; struct rio_detail *rio_detail_ptr = NULL;
list_for_each_entry (rio_detail_ptr, &rio_lo_head, rio_detail_list) { list_for_each_entry(rio_detail_ptr, &rio_lo_head, rio_detail_list) {
opt_rio_lo_ptr = search_opt_lo (rio_detail_ptr->chassis_num); opt_rio_lo_ptr = search_opt_lo (rio_detail_ptr->chassis_num);
if (!opt_rio_lo_ptr) { if (!opt_rio_lo_ptr) {
opt_rio_lo_ptr = kzalloc(sizeof(struct opt_rio_lo), GFP_KERNEL); opt_rio_lo_ptr = kzalloc(sizeof(struct opt_rio_lo), GFP_KERNEL);
...@@ -529,14 +529,14 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var) ...@@ -529,14 +529,14 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var)
int rc = 0; int rc = 0;
if (!var) { if (!var) {
list_for_each_entry (opt_vg_ptr, &opt_vg_head, opt_rio_list) { list_for_each_entry(opt_vg_ptr, &opt_vg_head, opt_rio_list) {
if ((first_slot < opt_vg_ptr->first_slot_num) && (slot_num >= opt_vg_ptr->first_slot_num)) { if ((first_slot < opt_vg_ptr->first_slot_num) && (slot_num >= opt_vg_ptr->first_slot_num)) {
rc = -ENODEV; rc = -ENODEV;
break; break;
} }
} }
} else { } else {
list_for_each_entry (opt_lo_ptr, &opt_lo_head, opt_rio_lo_list) { list_for_each_entry(opt_lo_ptr, &opt_lo_head, opt_rio_lo_list) {
if ((first_slot < opt_lo_ptr->first_slot_num) && (slot_num >= opt_lo_ptr->first_slot_num)) { if ((first_slot < opt_lo_ptr->first_slot_num) && (slot_num >= opt_lo_ptr->first_slot_num)) {
rc = -ENODEV; rc = -ENODEV;
break; break;
...@@ -550,7 +550,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num) ...@@ -550,7 +550,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num)
{ {
struct opt_rio_lo *opt_lo_ptr; struct opt_rio_lo *opt_lo_ptr;
list_for_each_entry (opt_lo_ptr, &opt_lo_head, opt_rio_lo_list) { list_for_each_entry(opt_lo_ptr, &opt_lo_head, opt_rio_lo_list) {
//check to see if this slot_num belongs to expansion box //check to see if this slot_num belongs to expansion box
if ((slot_num >= opt_lo_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_lo_ptr->first_slot_num, 1))) if ((slot_num >= opt_lo_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_lo_ptr->first_slot_num, 1)))
return opt_lo_ptr; return opt_lo_ptr;
...@@ -562,7 +562,7 @@ static struct opt_rio * find_chassis_num (u8 slot_num) ...@@ -562,7 +562,7 @@ static struct opt_rio * find_chassis_num (u8 slot_num)
{ {
struct opt_rio *opt_vg_ptr; struct opt_rio *opt_vg_ptr;
list_for_each_entry (opt_vg_ptr, &opt_vg_head, opt_rio_list) { list_for_each_entry(opt_vg_ptr, &opt_vg_head, opt_rio_list) {
//check to see if this slot_num belongs to chassis //check to see if this slot_num belongs to chassis
if ((slot_num >= opt_vg_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_vg_ptr->first_slot_num, 0))) if ((slot_num >= opt_vg_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_vg_ptr->first_slot_num, 0)))
return opt_vg_ptr; return opt_vg_ptr;
...@@ -578,7 +578,7 @@ static u8 calculate_first_slot (u8 slot_num) ...@@ -578,7 +578,7 @@ static u8 calculate_first_slot (u8 slot_num)
u8 first_slot = 1; u8 first_slot = 1;
struct slot * slot_cur; struct slot * slot_cur;
list_for_each_entry (slot_cur, &ibmphp_slot_head, ibm_slot_list) { list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
if (slot_cur->ctrl) { if (slot_cur->ctrl) {
if ((slot_cur->ctrl->ctlr_type != 4) && (slot_cur->ctrl->ending_slot_num > first_slot) && (slot_num > slot_cur->ctrl->ending_slot_num)) if ((slot_cur->ctrl->ctlr_type != 4) && (slot_cur->ctrl->ending_slot_num > first_slot) && (slot_num > slot_cur->ctrl->ending_slot_num))
first_slot = slot_cur->ctrl->ending_slot_num; first_slot = slot_cur->ctrl->ending_slot_num;
...@@ -963,7 +963,7 @@ static int __init ebda_rsrc_controller (void) ...@@ -963,7 +963,7 @@ static int __init ebda_rsrc_controller (void)
} /* each hpc */ } /* each hpc */
list_for_each_entry (tmp_slot, &ibmphp_slot_head, ibm_slot_list) { list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
snprintf (tmp_slot->hotplug_slot->name, 30, "%s", create_file_name (tmp_slot)); snprintf (tmp_slot->hotplug_slot->name, 30, "%s", create_file_name (tmp_slot));
pci_hp_register(tmp_slot->hotplug_slot, pci_hp_register(tmp_slot->hotplug_slot,
pci_find_bus(0, tmp_slot->bus), tmp_slot->device); pci_find_bus(0, tmp_slot->bus), tmp_slot->device);
...@@ -1066,7 +1066,7 @@ struct slot *ibmphp_get_slot_from_physical_num (u8 physical_num) ...@@ -1066,7 +1066,7 @@ struct slot *ibmphp_get_slot_from_physical_num (u8 physical_num)
{ {
struct slot *slot; struct slot *slot;
list_for_each_entry (slot, &ibmphp_slot_head, ibm_slot_list) { list_for_each_entry(slot, &ibmphp_slot_head, ibm_slot_list) {
if (slot->number == physical_num) if (slot->number == physical_num)
return slot; return slot;
} }
...@@ -1083,7 +1083,7 @@ struct bus_info *ibmphp_find_same_bus_num (u32 num) ...@@ -1083,7 +1083,7 @@ struct bus_info *ibmphp_find_same_bus_num (u32 num)
{ {
struct bus_info *ptr; struct bus_info *ptr;
list_for_each_entry (ptr, &bus_info_head, bus_info_list) { list_for_each_entry(ptr, &bus_info_head, bus_info_list) {
if (ptr->busno == num) if (ptr->busno == num)
return ptr; return ptr;
} }
...@@ -1097,7 +1097,7 @@ int ibmphp_get_bus_index (u8 num) ...@@ -1097,7 +1097,7 @@ int ibmphp_get_bus_index (u8 num)
{ {
struct bus_info *ptr; struct bus_info *ptr;
list_for_each_entry (ptr, &bus_info_head, bus_info_list) { list_for_each_entry(ptr, &bus_info_head, bus_info_list) {
if (ptr->busno == num) if (ptr->busno == num)
return ptr->index; return ptr->index;
} }
...@@ -1172,7 +1172,7 @@ int ibmphp_register_pci (void) ...@@ -1172,7 +1172,7 @@ int ibmphp_register_pci (void)
struct controller *ctrl; struct controller *ctrl;
int rc = 0; int rc = 0;
list_for_each_entry (ctrl, &ebda_hpc_head, ebda_hpc_list) { list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) {
if (ctrl->ctlr_type == 1) { if (ctrl->ctlr_type == 1) {
rc = pci_register_driver(&ibmphp_driver); rc = pci_register_driver(&ibmphp_driver);
break; break;
...@@ -1186,7 +1186,7 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids) ...@@ -1186,7 +1186,7 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids)
debug ("inside ibmphp_probe\n"); debug ("inside ibmphp_probe\n");
list_for_each_entry (ctrl, &ebda_hpc_head, ebda_hpc_list) { list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) {
if (ctrl->ctlr_type == 1) { if (ctrl->ctlr_type == 1) {
if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) { if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
ctrl->ctrl_dev = dev; ctrl->ctrl_dev = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment