Merge branch 'pci/trivial' into next
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 20 Jan 2016 17:48:25 +0000 (11:48 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 20 Jan 2016 17:48:25 +0000 (11:48 -0600)
* pci/trivial:
  PCI: shpchp: Constify hpc_ops structure
  PCI: Use kobj_to_dev() instead of open-coding it
  PCI: Use to_pci_dev() instead of open-coding it
  PCI: Fix all whitespace issues
  PCI/MSI: Fix typos in <linux/msi.h>

12 files changed:
1  2 
drivers/pci/host/pci-imx6.c
drivers/pci/hotplug/acpiphp_ibm.c
drivers/pci/hotplug/ibmphp_core.c
drivers/pci/hotplug/ibmphp_ebda.c
drivers/pci/hotplug/ibmphp_hpc.c
drivers/pci/hotplug/ibmphp_pci.c
drivers/pci/hotplug/ibmphp_res.c
drivers/pci/hotplug/pci_hotplug_core.c
drivers/pci/hotplug/pcihp_skeleton.c
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/hotplug/shpchp_core.c
drivers/pci/pci-sysfs.c

Simple merge
Simple merge
@@@ -113,12 -113,14 +113,12 @@@ static inline int slot_update(struct sl
        return rc;
  }
  
- static int __init get_max_slots (void)
+ static int __init get_max_slots(void)
  {
        struct slot *slot_cur;
 -      struct list_head *tmp;
        u8 slot_count = 0;
  
 -      list_for_each(tmp, &ibmphp_slot_head) {
 -              slot_cur = list_entry(tmp, struct slot, ibm_slot_list);
 +      list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
                /* sometimes the hot-pluggable slots start with 4 (not always from 1) */
                slot_count = max(slot_count, slot_cur->number);
        }
@@@ -1115,40 -1115,46 +1115,40 @@@ int ibmphp_get_bus_index(u8 num
        return -ENODEV;
  }
  
- void ibmphp_free_bus_info_queue (void)
+ void ibmphp_free_bus_info_queue(void)
  {
 -      struct bus_info *bus_info;
 -      struct list_head *list;
 -      struct list_head *next;
 +      struct bus_info *bus_info, *next;
  
 -      list_for_each_safe(list, next, &bus_info_head) {
 -              bus_info = list_entry(list, struct bus_info, bus_info_list);
 -              kfree(bus_info);
 +      list_for_each_entry_safe(bus_info, next, &bus_info_head,
 +                               bus_info_list) {
 +              kfree (bus_info);
        }
  }
  
- void ibmphp_free_ebda_hpc_queue (void)
+ void ibmphp_free_ebda_hpc_queue(void)
  {
 -      struct controller *controller = NULL;
 -      struct list_head *list;
 -      struct list_head *next;
 +      struct controller *controller = NULL, *next;
        int pci_flag = 0;
  
 -      list_for_each_safe(list, next, &ebda_hpc_head) {
 -              controller = list_entry(list, struct controller, ebda_hpc_list);
 +      list_for_each_entry_safe(controller, next, &ebda_hpc_head,
 +                               ebda_hpc_list) {
                if (controller->ctlr_type == 0)
-                       release_region (controller->u.isa_ctlr.io_start, (controller->u.isa_ctlr.io_end - controller->u.isa_ctlr.io_start + 1));
+                       release_region(controller->u.isa_ctlr.io_start, (controller->u.isa_ctlr.io_end - controller->u.isa_ctlr.io_start + 1));
                else if ((controller->ctlr_type == 1) && (!pci_flag)) {
                        ++pci_flag;
-                       pci_unregister_driver (&ibmphp_driver);
+                       pci_unregister_driver(&ibmphp_driver);
                }
-               free_ebda_hpc (controller);
+               free_ebda_hpc(controller);
        }
  }
  
- void ibmphp_free_ebda_pci_rsrc_queue (void)
+ void ibmphp_free_ebda_pci_rsrc_queue(void)
  {
 -      struct ebda_pci_rsrc *resource;
 -      struct list_head *list;
 -      struct list_head *next;
 +      struct ebda_pci_rsrc *resource, *next;
  
 -      list_for_each_safe(list, next, &ibmphp_ebda_pci_rsrc_head) {
 -              resource = list_entry(list, struct ebda_pci_rsrc, ebda_pci_rsrc_list);
 -              kfree(resource);
 +      list_for_each_entry_safe(resource, next, &ibmphp_ebda_pci_rsrc_head,
 +                               ebda_pci_rsrc_list) {
 +              kfree (resource);
                resource = NULL;
        }
  }
@@@ -627,14 -628,14 +627,14 @@@ int ibmphp_hpc_readslot(struct slot *ps
  
                        // Not used
                case READ_ALLSLOT:
 -                      list_for_each(pslotlist, &ibmphp_slot_head) {
 -                              pslot = list_entry(pslotlist, struct slot, ibm_slot_list);
 +                      list_for_each_entry(pslot, &ibmphp_slot_head,
 +                                          ibm_slot_list) {
                                index = pslot->ctlr_index;
-                               rc = hpc_wait_ctlr_notworking (HPC_CTLR_WORKING_TOUT, ctlr_ptr,
+                               rc = hpc_wait_ctlr_notworking(HPC_CTLR_WORKING_TOUT, ctlr_ptr,
                                                                wpg_bbar, &status);
                                if (!rc) {
-                                       pslot->status = ctrl_read (ctlr_ptr, wpg_bbar, index);
-                                       rc = hpc_wait_ctlr_notworking (HPC_CTLR_WORKING_TOUT,
+                                       pslot->status = ctrl_read(ctlr_ptr, wpg_bbar, index);
+                                       rc = hpc_wait_ctlr_notworking(HPC_CTLR_WORKING_TOUT,
                                                                        ctlr_ptr, wpg_bbar, &status);
                                        if (!rc)
                                                pslot->ext_status =
@@@ -836,14 -838,14 +836,14 @@@ static int poll_hpc(void *data
                case POLL_LATCH_REGISTER:
                        oldlatchlow = curlatchlow;
                        ctrl_count = 0x00;
 -                      list_for_each(pslotlist, &ibmphp_slot_head) {
 +                      list_for_each_entry(pslot, &ibmphp_slot_head,
 +                                          ibm_slot_list) {
                                if (ctrl_count >= ibmphp_get_total_controllers())
                                        break;
 -                              pslot = list_entry(pslotlist, struct slot, ibm_slot_list);
                                if (pslot->ctrl->ctlr_relative_id == ctrl_count) {
                                        ctrl_count++;
-                                       if (READ_SLOT_LATCH (pslot->ctrl)) {
-                                               rc = ibmphp_hpc_readslot (pslot,
+                                       if (READ_SLOT_LATCH(pslot->ctrl)) {
+                                               rc = ibmphp_hpc_readslot(pslot,
                                                                          READ_SLOTLATCHLOWREG,
                                                                          &curlatchlow);
                                                if (oldlatchlow != curlatchlow)
                        poll_state = POLL_SLEEP;
                        break;
                case POLL_SLOTS:
 -                      list_for_each(pslotlist, &ibmphp_slot_head) {
 -                              pslot = list_entry(pslotlist, struct slot, ibm_slot_list);
 +                      list_for_each_entry(pslot, &ibmphp_slot_head,
 +                                          ibm_slot_list) {
                                // make a copy of the old status
-                               memcpy ((void *) &myslot, (void *) pslot,
-                                       sizeof (struct slot));
-                               rc = ibmphp_hpc_readslot (pslot, READ_ALLSTAT, NULL);
+                               memcpy((void *) &myslot, (void *) pslot,
+                                       sizeof(struct slot));
+                               rc = ibmphp_hpc_readslot(pslot, READ_ALLSTAT, NULL);
                                if ((myslot.status != pslot->status)
                                    || (myslot.ext_status != pslot->ext_status))
-                                       process_changeinstatus (pslot, &myslot);
+                                       process_changeinstatus(pslot, &myslot);
                        }
                        ctrl_count = 0x00;
 -                      list_for_each(pslotlist, &ibmphp_slot_head) {
 +                      list_for_each_entry(pslot, &ibmphp_slot_head,
 +                                          ibm_slot_list) {
                                if (ctrl_count >= ibmphp_get_total_controllers())
                                        break;
 -                              pslot = list_entry(pslotlist, struct slot, ibm_slot_list);
                                if (pslot->ctrl->ctlr_relative_id == ctrl_count) {
                                        ctrl_count++;
-                                       if (READ_SLOT_LATCH (pslot->ctrl))
-                                               rc = ibmphp_hpc_readslot (pslot,
+                                       if (READ_SLOT_LATCH(pslot->ctrl))
+                                               rc = ibmphp_hpc_readslot(pslot,
                                                                          READ_SLOTLATCHLOWREG,
                                                                          &curlatchlow);
                                }
@@@ -1115,12 -1115,12 +1115,12 @@@ static struct res_needed *scan_behind_b
                                /* found correct device!!! */
                                howmany++;
  
-                               pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_HEADER_TYPE, &hdr_type);
-                               pci_bus_read_config_dword (ibmphp_pci_bus, devfn, PCI_CLASS_REVISION, &class);
+                               pci_bus_read_config_byte(ibmphp_pci_bus, devfn, PCI_HEADER_TYPE, &hdr_type);
+                               pci_bus_read_config_dword(ibmphp_pci_bus, devfn, PCI_CLASS_REVISION, &class);
  
-                               debug ("hdr_type behind the bridge is %x\n", hdr_type);
+                               debug("hdr_type behind the bridge is %x\n", hdr_type);
 -                              if (hdr_type & PCI_HEADER_TYPE_BRIDGE) {
 +                              if ((hdr_type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) {
-                                       err ("embedded bridges not supported for hot-plugging.\n");
+                                       err("embedded bridges not supported for hot-plugging.\n");
                                        amount->not_correct = 1;
                                        return amount;
                                }
@@@ -207,12 -208,13 +207,12 @@@ int __init ibmphp_rsrc_init(void
        struct resource_node *new_mem = NULL;
        struct resource_node *new_pfmem = NULL;
        int rc;
 -      struct list_head *tmp_ebda;
  
 -      list_for_each(tmp_ebda, &ibmphp_ebda_pci_rsrc_head) {
 -              curr = list_entry(tmp_ebda, struct ebda_pci_rsrc, ebda_pci_rsrc_list);
 +      list_for_each_entry(curr, &ibmphp_ebda_pci_rsrc_head,
 +                          ebda_pci_rsrc_list) {
                if (!(curr->rsrc_type & PCIDEVMASK)) {
                        /* EBDA still lists non PCI devices, so ignore... */
-                       debug ("this is not a PCI DEVICE in rsrc_init, please take care\n");
+                       debug("this is not a PCI DEVICE in rsrc_init, please take care\n");
                        // continue;
                }
  
                }
        }
  
 -      list_for_each(tmp, &gbuses) {
 -              bus_cur = list_entry(tmp, struct bus_node, bus_list);
 +      list_for_each_entry(bus_cur, &gbuses, bus_list) {
                /* This is to get info about PPB resources, since EBDA doesn't put this info into the primary bus info */
-               rc = update_bridge_ranges (&bus_cur);
+               rc = update_bridge_ranges(&bus_cur);
                if (rc)
                        return rc;
        }
@@@ -1566,9 -1569,9 +1566,9 @@@ int ibmphp_find_resource(struct bus_nod
   * Parameters: none
   * Returns: none
   ***********************************************************************/
- void ibmphp_free_resources (void)
+ void ibmphp_free_resources(void)
  {
 -      struct bus_node *bus_cur = NULL;
 +      struct bus_node *bus_cur = NULL, *next;
        struct bus_node *bus_tmp;
        struct range_node *range_cur;
        struct range_node *range_tmp;
@@@ -1751,18 -1759,22 +1751,18 @@@ int ibmphp_add_pfmem_from_mem(struct re
   * Parameters: bus_number
   * Returns: Bus pointer or NULL
   */
- struct bus_node *ibmphp_find_res_bus (u8 bus_number)
+ struct bus_node *ibmphp_find_res_bus(u8 bus_number)
  {
-       return find_bus_wprev (bus_number, NULL, 0);
+       return find_bus_wprev(bus_number, NULL, 0);
  }
  
- static struct bus_node *find_bus_wprev (u8 bus_number, struct bus_node **prev, u8 flag)
+ static struct bus_node *find_bus_wprev(u8 bus_number, struct bus_node **prev, u8 flag)
  {
        struct bus_node *bus_cur;
 -      struct list_head *tmp;
 -      struct list_head *tmp_prev;
  
 -      list_for_each(tmp, &gbuses) {
 -              tmp_prev = tmp->prev;
 -              bus_cur = list_entry(tmp, struct bus_node, bus_list);
 +      list_for_each_entry(bus_cur, &gbuses, bus_list) {
                if (flag)
 -                      *prev = list_entry(tmp_prev, struct bus_node, bus_list);
 +                      *prev = list_prev_entry(bus_cur, bus_list);
                if (bus_cur->busno == bus_number)
                        return bus_cur;
        }
@@@ -1776,11 -1788,12 +1776,11 @@@ void ibmphp_print_test(void
        struct bus_node *bus_cur = NULL;
        struct range_node *range;
        struct resource_node *res;
 -      struct list_head *tmp;
  
-       debug_pci ("*****************START**********************\n");
+       debug_pci("*****************START**********************\n");
  
        if ((!list_empty(&gbuses)) && flags) {
-               err ("The GBUSES is not NULL?!?!?!?!?\n");
+               err("The GBUSES is not NULL?!?!?!?!?\n");
                return;
        }
  
Simple merge
Simple merge
Simple merge
Simple merge