Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI Hotplug: cpqphp: fix comment style

Fix up comments from C++ to C-style, wrapping if necessary, etc.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Alex Chiang and committed by
Jesse Barnes
427438c6 861fefbf

+387 -315
+11 -11
drivers/pci/hotplug/cpqphp.h
··· 190 190 u32 reserved2; 191 191 } __attribute__ ((packed)); 192 192 193 - /* offsets to the hotplug resource table registers based on the above structure layout */ 193 + /* offsets to the hotplug resource table registers based on the above 194 + * structure layout 195 + */ 194 196 enum hrt_offsets { 195 197 SIG0 = offsetof(struct hrt, sig0), 196 198 SIG1 = offsetof(struct hrt, sig1), ··· 219 217 u16 pre_mem_length; 220 218 } __attribute__ ((packed)); 221 219 222 - /* offsets to the hotplug slot resource table registers based on the above structure layout */ 220 + /* offsets to the hotplug slot resource table registers based on the above 221 + * structure layout 222 + */ 223 223 enum slot_rt_offsets { 224 224 DEV_FUNC = offsetof(struct slot_rt, dev_func), 225 225 PRIMARY_BUS = offsetof(struct slot_rt, primary_bus), ··· 290 286 struct controller { 291 287 struct controller *next; 292 288 u32 ctrl_int_comp; 293 - struct mutex crit_sect; /* critical section mutex */ 294 - void __iomem *hpc_reg; /* cookie for our pci controller location */ 289 + struct mutex crit_sect; /* critical section mutex */ 290 + void __iomem *hpc_reg; /* cookie for our pci controller location */ 295 291 struct pci_resource *mem_head; 296 292 struct pci_resource *p_mem_head; 297 293 struct pci_resource *io_head; ··· 303 299 u8 next_event; 304 300 u8 interrupt; 305 301 u8 cfgspc_irq; 306 - u8 bus; /* bus number for the pci hotplug controller */ 302 + u8 bus; /* bus number for the pci hotplug controller */ 307 303 u8 rev; 308 304 u8 slot_device_offset; 309 305 u8 first_slot; ··· 462 458 * return_resource 463 459 * 464 460 * Puts node back in the resource list pointed to by head 465 - * 466 461 */ 467 462 static inline void return_resource(struct pci_resource **head, struct pci_resource *node) 468 463 { ··· 578 575 } 579 576 580 577 581 - /* 578 + /** 582 579 * get_controller_speed - find the current frequency/mode of controller. 583 580 * 584 581 * @ctrl: controller to get frequency/mode for. 585 582 * 586 583 * Returns controller speed. 587 - * 588 584 */ 589 585 static inline u8 get_controller_speed(struct controller *ctrl) 590 586 { ··· 609 607 } 610 608 611 609 612 - /* 610 + /** 613 611 * get_adapter_speed - find the max supported frequency/mode of adapter. 614 612 * 615 613 * @ctrl: hotplug controller. 616 614 * @hp_slot: hotplug slot where adapter is installed. 617 615 * 618 616 * Returns adapter speed. 619 - * 620 617 */ 621 618 static inline u8 get_adapter_speed(struct controller *ctrl, u8 hp_slot) 622 619 { ··· 720 719 } 721 720 722 721 #endif 723 -
+84 -73
drivers/pci/hotplug/cpqphp_core.c
··· 26 26 * 27 27 * Jan 12, 2003 - Added 66/100/133MHz PCI-X support, 28 28 * Torben Mathiasen <torben.mathiasen@hp.com> 29 - * 30 29 */ 31 30 32 31 #include <linux/module.h> ··· 170 171 tempdword = ctrl->first_slot; 171 172 172 173 number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; 173 - // Loop through slots 174 + /* Loop through slots */ 174 175 while (number_of_slots) { 175 176 physical_slot = tempdword; 176 177 writeb(0, ctrl->hpc_reg + SLOT_SERR); ··· 199 200 200 201 len = (routing_table->size - sizeof(struct irq_routing_table)) / 201 202 sizeof(struct irq_info); 202 - // Make sure I got at least one entry 203 + /* Make sure I got at least one entry */ 203 204 if (len == 0) { 204 205 kfree(routing_table); 205 206 return -1; ··· 243 244 if (!smbios_table || !curr) 244 245 return(NULL); 245 246 246 - // set p_max to the end of the table 247 + /* set p_max to the end of the table */ 247 248 p_max = smbios_start + readw(smbios_table + ST_LENGTH); 248 249 249 250 p_temp = curr; ··· 252 253 while ((p_temp < p_max) && !bail) { 253 254 /* Look for the double NULL terminator 254 255 * The first condition is the previous byte 255 - * and the second is the curr */ 256 + * and the second is the curr 257 + */ 256 258 if (!previous_byte && !(readb(p_temp))) { 257 259 bail = 1; 258 260 } ··· 387 387 slot->task_event.expires = jiffies + 5 * HZ; 388 388 slot->task_event.function = cpqhp_pushbutton_thread; 389 389 390 - //FIXME: these capabilities aren't used but if they are 391 - // they need to be correctly implemented 390 + /*FIXME: these capabilities aren't used but if they are 391 + * they need to be correctly implemented 392 + */ 392 393 slot->capabilities |= PCISLOT_REPLACE_SUPPORTED; 393 394 slot->capabilities |= PCISLOT_INTERLOCK_SUPPORTED; 394 395 ··· 403 402 ctrl_slot = 404 403 slot_device - (readb(ctrl->hpc_reg + SLOT_MASK) >> 4); 405 404 406 - // Check presence 405 + /* Check presence */ 407 406 slot->capabilities |= 408 407 ((((~tempdword) >> 23) | 409 408 ((~tempdword) >> 15)) >> ctrl_slot) & 0x02; 410 - // Check the switch state 409 + /* Check the switch state */ 411 410 slot->capabilities |= 412 411 ((~tempdword & 0xFF) >> ctrl_slot) & 0x01; 413 - // Check the slot enable 412 + /* Check the slot enable */ 414 413 slot->capabilities |= 415 414 ((read_slot_enable(ctrl) << 2) >> ctrl_slot) & 0x04; 416 415 ··· 477 476 478 477 cpqhp_remove_debugfs_files(ctrl); 479 478 480 - //Free IRQ associated with hot plug device 479 + /* Free IRQ associated with hot plug device */ 481 480 free_irq(ctrl->interrupt, ctrl); 482 - //Unmap the memory 481 + /* Unmap the memory */ 483 482 iounmap(ctrl->hpc_reg); 484 - //Finally reclaim PCI mem 483 + /* Finally reclaim PCI mem */ 485 484 release_mem_region(pci_resource_start(ctrl->pci_dev, 0), 486 485 pci_resource_len(ctrl->pci_dev, 0)); 487 486 ··· 489 488 } 490 489 491 490 492 - //============================================================================ 493 - // function: get_slot_mapping 494 - // 495 - // Description: Attempts to determine a logical slot mapping for a PCI 496 - // device. Won't work for more than one PCI-PCI bridge 497 - // in a slot. 498 - // 499 - // Input: u8 bus_num - bus number of PCI device 500 - // u8 dev_num - device number of PCI device 501 - // u8 *slot - Pointer to u8 where slot number will 502 - // be returned 503 - // 504 - // Output: SUCCESS or FAILURE 505 - //============================================================================= 491 + /** 492 + * get_slot_mapping - determine logical slot mapping for PCI device 493 + * 494 + * Won't work for more than one PCI-PCI bridge in a slot. 495 + * 496 + * @bus_num - bus number of PCI device 497 + * @dev_num - device number of PCI device 498 + * @slot - Pointer to u8 where slot number will be returned 499 + * 500 + * Output: SUCCESS or FAILURE 501 + */ 506 502 static int 507 503 get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) 508 504 { ··· 520 522 521 523 len = (PCIIRQRoutingInfoLength->size - 522 524 sizeof(struct irq_routing_table)) / sizeof(struct irq_info); 523 - // Make sure I got at least one entry 525 + /* Make sure I got at least one entry */ 524 526 if (len == 0) { 525 527 kfree(PCIIRQRoutingInfoLength); 526 528 return -1; ··· 537 539 return 0; 538 540 } else { 539 541 /* Did not get a match on the target PCI device. Check 540 - * if the current IRQ table entry is a PCI-to-PCI bridge 541 - * device. If so, and it's secondary bus matches the 542 - * bus number for the target device, I need to save the 543 - * bridge's slot number. If I can not find an entry for 544 - * the target device, I will have to assume it's on the 545 - * other side of the bridge, and assign it the bridge's 546 - * slot. */ 542 + * if the current IRQ table entry is a PCI-to-PCI 543 + * bridge device. If so, and it's secondary bus 544 + * matches the bus number for the target device, I need 545 + * to save the bridge's slot number. If I can not find 546 + * an entry for the target device, I will have to 547 + * assume it's on the other side of the bridge, and 548 + * assign it the bridge's slot. 549 + */ 547 550 bus->number = tbus; 548 551 pci_bus_read_config_dword(bus, PCI_DEVFN(tdevice, 0), 549 552 PCI_CLASS_REVISION, &work); ··· 562 563 563 564 } 564 565 565 - // If we got here, we didn't find an entry in the IRQ mapping table 566 - // for the target PCI device. If we did determine that the target 567 - // device is on the other side of a PCI-to-PCI bridge, return the 568 - // slot number for the bridge. 566 + /* If we got here, we didn't find an entry in the IRQ mapping table for 567 + * the target PCI device. If we did determine that the target device 568 + * is on the other side of a PCI-to-PCI bridge, return the slot number 569 + * for the bridge. 570 + */ 569 571 if (bridgeSlot != 0xFF) { 570 572 *slot = bridgeSlot; 571 573 kfree(PCIIRQRoutingInfoLength); 572 574 return 0; 573 575 } 574 576 kfree(PCIIRQRoutingInfoLength); 575 - // Couldn't find an entry in the routing table for this PCI device 577 + /* Couldn't find an entry in the routing table for this PCI device */ 576 578 return -1; 577 579 } 578 580 ··· 595 595 596 596 hp_slot = func->device - ctrl->slot_device_offset; 597 597 598 - // Wait for exclusive access to hardware 598 + /* Wait for exclusive access to hardware */ 599 599 mutex_lock(&ctrl->crit_sect); 600 600 601 601 if (status == 1) { ··· 603 603 } else if (status == 0) { 604 604 amber_LED_off (ctrl, hp_slot); 605 605 } else { 606 - // Done with exclusive hardware access 606 + /* Done with exclusive hardware access */ 607 607 mutex_unlock(&ctrl->crit_sect); 608 608 return(1); 609 609 } 610 610 611 611 set_SOGO(ctrl); 612 612 613 - // Wait for SOBS to be unset 613 + /* Wait for SOBS to be unset */ 614 614 wait_for_ctrl_irq (ctrl); 615 615 616 - // Done with exclusive hardware access 616 + /* Done with exclusive hardware access */ 617 617 mutex_unlock(&ctrl->crit_sect); 618 618 619 619 return(0); ··· 815 815 return err; 816 816 } 817 817 818 - // Need to read VID early b/c it's used to differentiate CPQ and INTC discovery 818 + /* Need to read VID early b/c it's used to differentiate CPQ and INTC 819 + * discovery 820 + */ 819 821 rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); 820 822 if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { 821 823 err(msg_HPC_non_compaq_or_intel); ··· 839 837 * Also Intel HPC's may have RID=0. 840 838 */ 841 839 if ((pdev->revision > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) { 842 - // TODO: This code can be made to support non-Compaq or Intel subsystem IDs 840 + /* TODO: This code can be made to support non-Compaq or Intel 841 + * subsystem IDs 842 + */ 843 843 rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); 844 844 if (rc) { 845 845 err("%s : pci_read_config_word failed\n", __func__); ··· 869 865 870 866 info("Hot Plug Subsystem Device ID: %x\n", subsystem_deviceid); 871 867 872 - /* Set Vendor ID, so it can be accessed later from other functions */ 868 + /* Set Vendor ID, so it can be accessed later from other 869 + * functions 870 + */ 873 871 ctrl->vendor_id = vendor_id; 874 872 875 873 switch (subsystem_vid) { ··· 998 992 999 993 /* PHP Status (0=De-feature PHP, 1=Normal operation) */ 1000 994 if (subsystem_deviceid & 0x0008) { 1001 - ctrl->defeature_PHP = 1; // PHP supported 995 + ctrl->defeature_PHP = 1; /* PHP supported */ 1002 996 } else { 1003 - ctrl->defeature_PHP = 0; // PHP not supported 997 + ctrl->defeature_PHP = 0; /* PHP not supported */ 1004 998 } 1005 999 1006 1000 /* Alternate Base Address Register Interface (0=not supported, 1=supported) */ 1007 1001 if (subsystem_deviceid & 0x0010) { 1008 - ctrl->alternate_base_address = 1; // supported 1002 + ctrl->alternate_base_address = 1; /* supported */ 1009 1003 } else { 1010 - ctrl->alternate_base_address = 0; // not supported 1004 + ctrl->alternate_base_address = 0; /* not supported */ 1011 1005 } 1012 1006 1013 1007 /* PCI Config Space Index (0=not supported, 1=supported) */ 1014 1008 if (subsystem_deviceid & 0x0020) { 1015 - ctrl->pci_config_space = 1; // supported 1009 + ctrl->pci_config_space = 1; /* supported */ 1016 1010 } else { 1017 - ctrl->pci_config_space = 0; // not supported 1011 + ctrl->pci_config_space = 0; /* not supported */ 1018 1012 } 1019 1013 1020 1014 /* PCI-X support */ ··· 1048 1042 return -ENODEV; 1049 1043 } 1050 1044 1051 - // Tell the user that we found one. 1045 + /* Tell the user that we found one. */ 1052 1046 info("Initializing the PCI hot plug controller residing on PCI bus %d\n", 1053 1047 pdev->bus->number); 1054 1048 ··· 1126 1120 * 1127 1121 ********************************************************/ 1128 1122 1129 - // find the physical slot number of the first hot plug slot 1123 + /* find the physical slot number of the first hot plug slot */ 1130 1124 1131 1125 /* Get slot won't work for devices behind bridges, but 1132 1126 * in this case it will always be called for the "base" ··· 1143 1137 goto err_iounmap; 1144 1138 } 1145 1139 1146 - // Store PCI Config Space for all devices on this bus 1140 + /* Store PCI Config Space for all devices on this bus */ 1147 1141 rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); 1148 1142 if (rc) { 1149 1143 err("%s: unable to save PCI configuration data, error %d\n", ··· 1154 1148 /* 1155 1149 * Get IO, memory, and IRQ resources for new devices 1156 1150 */ 1157 - // The next line is required for cpqhp_find_available_resources 1151 + /* The next line is required for cpqhp_find_available_resources */ 1158 1152 ctrl->interrupt = pdev->irq; 1159 1153 if (ctrl->interrupt < 0x10) { 1160 1154 cpqhp_legacy_mode = 1; ··· 1202 1196 goto err_iounmap; 1203 1197 } 1204 1198 1205 - /* Enable Shift Out interrupt and clear it, also enable SERR on power fault */ 1199 + /* Enable Shift Out interrupt and clear it, also enable SERR on power 1200 + * fault 1201 + */ 1206 1202 temp_word = readw(ctrl->hpc_reg + MISC); 1207 1203 temp_word |= 0x4006; 1208 1204 writew(temp_word, ctrl->hpc_reg + MISC); 1209 1205 1210 - // Changed 05/05/97 to clear all interrupts at start 1206 + /* Changed 05/05/97 to clear all interrupts at start */ 1211 1207 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_INPUT_CLEAR); 1212 1208 1213 1209 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); ··· 1224 1216 cpqhp_ctrl_list = ctrl; 1225 1217 } 1226 1218 1227 - // turn off empty slots here unless command line option "ON" set 1228 - // Wait for exclusive access to hardware 1219 + /* turn off empty slots here unless command line option "ON" set 1220 + * Wait for exclusive access to hardware 1221 + */ 1229 1222 mutex_lock(&ctrl->crit_sect); 1230 1223 1231 1224 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; 1232 1225 1233 - // find first device number for the ctrl 1226 + /* find first device number for the ctrl */ 1234 1227 device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; 1235 1228 1236 1229 while (num_of_slots) { ··· 1243 1234 hp_slot = func->device - ctrl->slot_device_offset; 1244 1235 dbg("hp_slot: %d\n", hp_slot); 1245 1236 1246 - // We have to save the presence info for these slots 1237 + /* We have to save the presence info for these slots */ 1247 1238 temp_word = ctrl->ctrl_int_comp >> 16; 1248 1239 func->presence_save = (temp_word >> hp_slot) & 0x01; 1249 1240 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; ··· 1267 1258 1268 1259 if (!power_mode) { 1269 1260 set_SOGO(ctrl); 1270 - // Wait for SOBS to be unset 1261 + /* Wait for SOBS to be unset */ 1271 1262 wait_for_ctrl_irq(ctrl); 1272 1263 } 1273 1264 ··· 1278 1269 goto err_free_irq; 1279 1270 } 1280 1271 1281 - // Done with exclusive hardware access 1272 + /* Done with exclusive hardware access */ 1282 1273 mutex_unlock(&ctrl->crit_sect); 1283 1274 1284 1275 cpqhp_create_debugfs_files(ctrl); ··· 1325 1316 cpqhp_slot_list[loop] = NULL; 1326 1317 } 1327 1318 1328 - // FIXME: We also need to hook the NMI handler eventually. 1329 - // this also needs to be worked with Christoph 1330 - // register_NMI_handler(); 1331 - 1332 - // Map rom address 1319 + /* FIXME: We also need to hook the NMI handler eventually. 1320 + * this also needs to be worked with Christoph 1321 + * register_NMI_handler(); 1322 + */ 1323 + /* Map rom address */ 1333 1324 cpqhp_rom_start = ioremap(ROM_PHY_ADDR, ROM_PHY_LEN); 1334 1325 if (!cpqhp_rom_start) { 1335 1326 err ("Could not ioremap memory region for ROM\n"); ··· 1337 1328 goto error; 1338 1329 } 1339 1330 1340 - /* Now, map the int15 entry point if we are on compaq specific hardware */ 1331 + /* Now, map the int15 entry point if we are on compaq specific 1332 + * hardware 1333 + */ 1341 1334 compaq_nvram_init(cpqhp_rom_start); 1342 1335 1343 1336 /* Map smbios table entry point structure */ ··· 1473 1462 } 1474 1463 } 1475 1464 1476 - // Stop the notification mechanism 1465 + /* Stop the notification mechanism */ 1477 1466 if (initialized) 1478 1467 cpqhp_event_stop_thread(); 1479 1468 1480 - //unmap the rom address 1469 + /* unmap the rom address */ 1481 1470 if (cpqhp_rom_start) 1482 1471 iounmap(cpqhp_rom_start); 1483 1472 if (smbios_start)
+77 -54
drivers/pci/hotplug/cpqphp_ctrl.c
··· 81 81 82 82 for (hp_slot = 0; hp_slot < 6; hp_slot++) { 83 83 if (change & (0x1L << hp_slot)) { 84 - /********************************** 84 + /* 85 85 * this one changed. 86 - **********************************/ 86 + */ 87 87 func = cpqhp_slot_find(ctrl->bus, 88 88 (hp_slot + ctrl->slot_device_offset), 0); 89 89 90 90 /* this is the structure that tells the worker thread 91 - *what to do */ 91 + * what to do 92 + */ 92 93 taskInfo = &(ctrl->event_queue[ctrl->next_event]); 93 94 ctrl->next_event = (ctrl->next_event + 1) % 10; 94 95 taskInfo->hp_slot = hp_slot; ··· 101 100 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; 102 101 103 102 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { 104 - /********************************** 103 + /* 105 104 * Switch opened 106 - **********************************/ 105 + */ 107 106 108 107 func->switch_save = 0; 109 108 110 109 taskInfo->event_type = INT_SWITCH_OPEN; 111 110 } else { 112 - /********************************** 111 + /* 113 112 * Switch closed 114 - **********************************/ 113 + */ 115 114 116 115 func->switch_save = 0x10; 117 116 ··· 153 152 if (!change) 154 153 return 0; 155 154 156 - /********************************** 155 + /* 157 156 * Presence Change 158 - **********************************/ 157 + */ 159 158 dbg("cpqsbd: Presence/Notify input change.\n"); 160 159 dbg(" Changed bits are 0x%4.4x\n", change ); 161 160 162 161 for (hp_slot = 0; hp_slot < 6; hp_slot++) { 163 162 if (change & (0x0101 << hp_slot)) { 164 - /********************************** 163 + /* 165 164 * this one changed. 166 - **********************************/ 165 + */ 167 166 func = cpqhp_slot_find(ctrl->bus, 168 167 (hp_slot + ctrl->slot_device_offset), 0); 169 168 ··· 178 177 return 0; 179 178 180 179 /* If the switch closed, must be a button 181 - * If not in button mode, nevermind */ 180 + * If not in button mode, nevermind 181 + */ 182 182 if (func->switch_save && (ctrl->push_button == 1)) { 183 183 temp_word = ctrl->ctrl_int_comp >> 16; 184 184 temp_byte = (temp_word >> hp_slot) & 0x01; 185 185 temp_byte |= (temp_word >> (hp_slot + 7)) & 0x02; 186 186 187 187 if (temp_byte != func->presence_save) { 188 - /************************************** 188 + /* 189 189 * button Pressed (doesn't do anything) 190 - **************************************/ 190 + */ 191 191 dbg("hp_slot %d button pressed\n", hp_slot); 192 192 taskInfo->event_type = INT_BUTTON_PRESS; 193 193 } else { 194 - /********************************** 194 + /* 195 195 * button Released - TAKE ACTION!!!! 196 - **********************************/ 196 + */ 197 197 dbg("hp_slot %d button released\n", hp_slot); 198 198 taskInfo->event_type = INT_BUTTON_RELEASE; 199 199 ··· 212 210 } 213 211 } else { 214 212 /* Switch is open, assume a presence change 215 - * Save the presence state */ 213 + * Save the presence state 214 + */ 216 215 temp_word = ctrl->ctrl_int_comp >> 16; 217 216 func->presence_save = (temp_word >> hp_slot) & 0x01; 218 217 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; ··· 244 241 if (!change) 245 242 return 0; 246 243 247 - /********************************** 244 + /* 248 245 * power fault 249 - **********************************/ 246 + */ 250 247 251 248 info("power fault interrupt\n"); 252 249 253 250 for (hp_slot = 0; hp_slot < 6; hp_slot++) { 254 251 if (change & (0x01 << hp_slot)) { 255 - /********************************** 252 + /* 256 253 * this one changed. 257 - **********************************/ 254 + */ 258 255 func = cpqhp_slot_find(ctrl->bus, 259 256 (hp_slot + ctrl->slot_device_offset), 0); 260 257 ··· 265 262 rc++; 266 263 267 264 if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) { 268 - /********************************** 265 + /* 269 266 * power fault Cleared 270 - **********************************/ 267 + */ 271 268 func->status = 0x00; 272 269 273 270 taskInfo->event_type = INT_POWER_FAULT_CLEAR; 274 271 } else { 275 - /********************************** 272 + /* 276 273 * power fault 277 - **********************************/ 274 + */ 278 275 taskInfo->event_type = INT_POWER_FAULT; 279 276 280 277 if (ctrl->rev < 4) { ··· 435 432 436 433 437 434 /* If we got here, there the bridge requires some of the resource, but 438 - * we may be able to split some off of the front */ 435 + * we may be able to split some off of the front 436 + */ 439 437 440 438 node = *head; 441 439 442 440 if (node->length & (alignment -1)) { 443 441 /* this one isn't an aligned length, so we'll make a new entry 444 - * and split it up. */ 442 + * and split it up. 443 + */ 445 444 split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); 446 445 447 446 if (!split_node) ··· 561 556 562 557 if (node->base & (size - 1)) { 563 558 /* this one isn't base aligned properly 564 - * so we'll make a new entry and split it up */ 559 + * so we'll make a new entry and split it up 560 + */ 565 561 temp_dword = (node->base | (size-1)) + 1; 566 562 567 563 /* Short circuit if adjusted size is too small */ ··· 587 581 /* Don't need to check if too small since we already did */ 588 582 if (node->length > size) { 589 583 /* this one is longer than we need 590 - * so we'll make a new entry and split it up */ 584 + * so we'll make a new entry and split it up 585 + */ 591 586 split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); 592 587 593 588 if (!split_node) ··· 608 601 continue; 609 602 610 603 /* If we got here, then it is the right size 611 - * Now take it out of the list and break */ 604 + * Now take it out of the list and break 605 + */ 612 606 if (*head == node) { 613 607 *head = node->next; 614 608 } else { ··· 651 643 652 644 for (max = *head; max; max = max->next) { 653 645 /* If not big enough we could probably just bail, 654 - * instead we'll continue to the next. */ 646 + * instead we'll continue to the next. 647 + */ 655 648 if (max->length < size) 656 649 continue; 657 650 658 651 if (max->base & (size - 1)) { 659 652 /* this one isn't base aligned properly 660 - * so we'll make a new entry and split it up */ 653 + * so we'll make a new entry and split it up 654 + */ 661 655 temp_dword = (max->base | (size-1)) + 1; 662 656 663 657 /* Short circuit if adjusted size is too small */ ··· 682 672 683 673 if ((max->base + max->length) & (size - 1)) { 684 674 /* this one isn't end aligned properly at the top 685 - * so we'll make a new entry and split it up */ 675 + * so we'll make a new entry and split it up 676 + */ 686 677 split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); 687 678 688 679 if (!split_node) ··· 755 744 if (node->base & (size - 1)) { 756 745 dbg("%s: not aligned\n", __func__); 757 746 /* this one isn't base aligned properly 758 - * so we'll make a new entry and split it up */ 747 + * so we'll make a new entry and split it up 748 + */ 759 749 temp_dword = (node->base | (size-1)) + 1; 760 750 761 751 /* Short circuit if adjusted size is too small */ ··· 781 769 if (node->length > size) { 782 770 dbg("%s: too big\n", __func__); 783 771 /* this one is longer than we need 784 - * so we'll make a new entry and split it up */ 772 + * so we'll make a new entry and split it up 773 + */ 785 774 split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); 786 775 787 776 if (!split_node) ··· 901 888 902 889 903 890 misc = readw(ctrl->hpc_reg + MISC); 904 - /*************************************** 891 + /* 905 892 * Check to see if it was our interrupt 906 - ***************************************/ 893 + */ 907 894 if (!(misc & 0x000C)) { 908 895 return IRQ_NONE; 909 896 } 910 897 911 898 if (misc & 0x0004) { 912 - /********************************** 899 + /* 913 900 * Serial Output interrupt Pending 914 - **********************************/ 901 + */ 915 902 916 903 /* Clear the interrupt */ 917 904 misc |= 0x0004; ··· 976 963 new_slot = kzalloc(sizeof(*new_slot), GFP_KERNEL); 977 964 if (new_slot == NULL) { 978 965 /* I'm not dead yet! 979 - * You will be. */ 966 + * You will be. 967 + */ 980 968 return new_slot; 981 969 } 982 970 ··· 1149 1135 return 0; 1150 1136 1151 1137 /* We don't allow freq/mode changes if we find another adapter running 1152 - * in another slot on this controller */ 1138 + * in another slot on this controller 1139 + */ 1153 1140 for(slot = ctrl->slot; slot; slot = slot->next) { 1154 1141 if (slot->device == (hp_slot + ctrl->slot_device_offset)) 1155 1142 continue; ··· 1160 1145 continue; 1161 1146 /* If another adapter is running on the same segment but at a 1162 1147 * lower speed/mode, we allow the new adapter to function at 1163 - * this rate if supported */ 1148 + * this rate if supported 1149 + */ 1164 1150 if (ctrl->speed < adapter_speed) 1165 1151 return 0; 1166 1152 ··· 1169 1153 } 1170 1154 1171 1155 /* If the controller doesn't support freq/mode changes and the 1172 - * controller is running at a higher mode, we bail */ 1156 + * controller is running at a higher mode, we bail 1157 + */ 1173 1158 if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) 1174 1159 return 1; 1175 1160 ··· 1179 1162 return 0; 1180 1163 1181 1164 /* We try to set the max speed supported by both the adapter and 1182 - * controller */ 1165 + * controller 1166 + */ 1183 1167 if (ctrl->speed_capability < adapter_speed) { 1184 1168 if (ctrl->speed == ctrl->speed_capability) 1185 1169 return 0; ··· 1262 1244 } 1263 1245 1264 1246 /* the following routines constitute the bulk of the 1265 - hotplug controller logic 1247 + * hotplug controller logic 1266 1248 */ 1267 1249 1268 1250 ··· 1287 1269 hp_slot = func->device - ctrl->slot_device_offset; 1288 1270 1289 1271 if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) { 1290 - /********************************** 1272 + /* 1291 1273 * The switch is open. 1292 - **********************************/ 1274 + */ 1293 1275 rc = INTERLOCK_OPEN; 1294 1276 } else if (is_slot_enabled (ctrl, hp_slot)) { 1295 - /********************************** 1277 + /* 1296 1278 * The board is already on 1297 - **********************************/ 1279 + */ 1298 1280 rc = CARD_FUNCTIONING; 1299 1281 } else { 1300 1282 mutex_lock(&ctrl->crit_sect); ··· 1370 1352 * Get slot won't work for devices behind 1371 1353 * bridges, but in this case it will always be 1372 1354 * called for the "base" bus/dev/func of an 1373 - * adapter. */ 1355 + * adapter. 1356 + */ 1374 1357 1375 1358 mutex_lock(&ctrl->crit_sect); 1376 1359 ··· 1396 1377 1397 1378 * Get slot won't work for devices behind bridges, but 1398 1379 * in this case it will always be called for the "base" 1399 - * bus/dev/func of an adapter. */ 1380 + * bus/dev/func of an adapter. 1381 + */ 1400 1382 1401 1383 mutex_lock(&ctrl->crit_sect); 1402 1384 ··· 1454 1434 wait_for_ctrl_irq (ctrl); 1455 1435 1456 1436 /* Change bits in slot power register to force another shift out 1457 - * NOTE: this is to work around the timer bug */ 1437 + * NOTE: this is to work around the timer bug 1438 + */ 1458 1439 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); 1459 1440 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); 1460 1441 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); ··· 2505 2484 temp_resources.irqs = &irqs; 2506 2485 2507 2486 /* Make copies of the nodes we are going to pass down so that 2508 - * if there is a problem,we can just use these to free resources */ 2487 + * if there is a problem,we can just use these to free resources 2488 + */ 2509 2489 hold_bus_node = kmalloc(sizeof(*hold_bus_node), GFP_KERNEL); 2510 2490 hold_IO_node = kmalloc(sizeof(*hold_IO_node), GFP_KERNEL); 2511 2491 hold_mem_node = kmalloc(sizeof(*hold_mem_node), GFP_KERNEL); ··· 2578 2556 temp_word = (p_mem_node->base + p_mem_node->length - 1) >> 16; 2579 2557 rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); 2580 2558 2581 - /* Adjust this to compensate for extra adjustment in first loop */ 2559 + /* Adjust this to compensate for extra adjustment in first loop 2560 + */ 2582 2561 irqs.barber_pole--; 2583 2562 2584 2563 rc = 0;
+42 -37
drivers/pci/hotplug/cpqphp_nvram.c
··· 94 94 95 95 static void __iomem *compaq_int15_entry_point; 96 96 97 - static spinlock_t int15_lock; /* lock for ordering int15_bios_call() */ 97 + /* lock for ordering int15_bios_call() */ 98 + static spinlock_t int15_lock; 98 99 99 100 100 101 /* This is a series of function that deals with 101 - setting & getting the hotplug resource table in some environment variable. 102 - */ 102 + * setting & getting the hotplug resource table in some environment variable. 103 + */ 103 104 104 105 /* 105 106 * We really shouldn't be doing this unless there is a _very_ good reason to!!! ··· 211 210 212 211 available = 1024; 213 212 214 - // Now load the EV 213 + /* Now load the EV */ 215 214 temp_dword = available; 216 215 217 216 rc = access_EV(READ_EV, "CQTHPS", evbuffer, &temp_dword); 218 217 219 218 evbuffer_length = temp_dword; 220 219 221 - // We're maintaining the resource lists so write FF to invalidate old info 220 + /* We're maintaining the resource lists so write FF to invalidate old 221 + * info 222 + */ 222 223 temp_dword = 1; 223 224 224 225 rc = access_EV(WRITE_EV, "CQTHPS", &temp_byte, &temp_dword); ··· 267 264 268 265 ctrl = cpqhp_ctrl_list; 269 266 270 - // The revision of this structure 267 + /* The revision of this structure */ 271 268 rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); 272 269 if (rc) 273 270 return(rc); 274 271 275 - // The number of controllers 272 + /* The number of controllers */ 276 273 rc = add_byte( &pFill, 1, &usedbytes, &available); 277 274 if (rc) 278 275 return(rc); ··· 282 279 283 280 numCtrl++; 284 281 285 - // The bus number 282 + /* The bus number */ 286 283 rc = add_byte( &pFill, ctrl->bus, &usedbytes, &available); 287 284 if (rc) 288 285 return(rc); 289 286 290 - // The device Number 287 + /* The device Number */ 291 288 rc = add_byte( &pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available); 292 289 if (rc) 293 290 return(rc); 294 291 295 - // The function Number 292 + /* The function Number */ 296 293 rc = add_byte( &pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available); 297 294 if (rc) 298 295 return(rc); 299 296 300 - // Skip the number of available entries 297 + /* Skip the number of available entries */ 301 298 rc = add_dword( &pFill, 0, &usedbytes, &available); 302 299 if (rc) 303 300 return(rc); 304 301 305 - // Figure out memory Available 302 + /* Figure out memory Available */ 306 303 307 304 resNode = ctrl->mem_head; 308 305 ··· 311 308 while (resNode) { 312 309 loop ++; 313 310 314 - // base 311 + /* base */ 315 312 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 316 313 if (rc) 317 314 return(rc); 318 315 319 - // length 316 + /* length */ 320 317 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 321 318 if (rc) 322 319 return(rc); ··· 324 321 resNode = resNode->next; 325 322 } 326 323 327 - // Fill in the number of entries 324 + /* Fill in the number of entries */ 328 325 p_ev_ctrl->mem_avail = loop; 329 326 330 - // Figure out prefetchable memory Available 327 + /* Figure out prefetchable memory Available */ 331 328 332 329 resNode = ctrl->p_mem_head; 333 330 ··· 336 333 while (resNode) { 337 334 loop ++; 338 335 339 - // base 336 + /* base */ 340 337 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 341 338 if (rc) 342 339 return(rc); 343 340 344 - // length 341 + /* length */ 345 342 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 346 343 if (rc) 347 344 return(rc); ··· 349 346 resNode = resNode->next; 350 347 } 351 348 352 - // Fill in the number of entries 349 + /* Fill in the number of entries */ 353 350 p_ev_ctrl->p_mem_avail = loop; 354 351 355 - // Figure out IO Available 352 + /* Figure out IO Available */ 356 353 357 354 resNode = ctrl->io_head; 358 355 ··· 361 358 while (resNode) { 362 359 loop ++; 363 360 364 - // base 361 + /* base */ 365 362 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 366 363 if (rc) 367 364 return(rc); 368 365 369 - // length 366 + /* length */ 370 367 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 371 368 if (rc) 372 369 return(rc); ··· 374 371 resNode = resNode->next; 375 372 } 376 373 377 - // Fill in the number of entries 374 + /* Fill in the number of entries */ 378 375 p_ev_ctrl->io_avail = loop; 379 376 380 - // Figure out bus Available 377 + /* Figure out bus Available */ 381 378 382 379 resNode = ctrl->bus_head; 383 380 ··· 386 383 while (resNode) { 387 384 loop ++; 388 385 389 - // base 386 + /* base */ 390 387 rc = add_dword( &pFill, resNode->base, &usedbytes, &available); 391 388 if (rc) 392 389 return(rc); 393 390 394 - // length 391 + /* length */ 395 392 rc = add_dword( &pFill, resNode->length, &usedbytes, &available); 396 393 if (rc) 397 394 return(rc); ··· 399 396 resNode = resNode->next; 400 397 } 401 398 402 - // Fill in the number of entries 399 + /* Fill in the number of entries */ 403 400 p_ev_ctrl->bus_avail = loop; 404 401 405 402 ctrl = ctrl->next; ··· 407 404 408 405 p_EV_header->num_of_ctrl = numCtrl; 409 406 410 - // Now store the EV 407 + /* Now store the EV */ 411 408 412 409 temp_dword = usedbytes; 413 410 ··· 452 449 struct ev_hrt_header *p_EV_header; 453 450 454 451 if (!evbuffer_init) { 455 - // Read the resource list information in from NVRAM 452 + /* Read the resource list information in from NVRAM */ 456 453 if (load_HRT(rom_start)) 457 454 memset (evbuffer, 0, 1024); 458 455 459 456 evbuffer_init = 1; 460 457 } 461 458 462 - // If we saved information in NVRAM, use it now 459 + /* If we saved information in NVRAM, use it now */ 463 460 p_EV_header = (struct ev_hrt_header *) evbuffer; 464 461 465 - // The following code is for systems where version 1.0 of this 466 - // driver has been loaded, but doesn't support the hardware. 467 - // In that case, the driver would incorrectly store something 468 - // in NVRAM. 462 + /* The following code is for systems where version 1.0 of this 463 + * driver has been loaded, but doesn't support the hardware. 464 + * In that case, the driver would incorrectly store something 465 + * in NVRAM. 466 + */ 469 467 if ((p_EV_header->Version == 2) || 470 468 ((p_EV_header->Version == 1) && !ctrl->push_flag)) { 471 469 p_byte = &(p_EV_header->next); ··· 495 491 if (p_byte > ((u8*)p_EV_header + evbuffer_length)) 496 492 return 2; 497 493 498 - // Skip forward to the next entry 494 + /* Skip forward to the next entry */ 499 495 p_byte += (nummem + numpmem + numio + numbus) * 8; 500 496 501 497 if (p_byte > ((u8*)p_EV_header + evbuffer_length)) ··· 633 629 ctrl->bus_head = bus_node; 634 630 } 635 631 636 - // If all of the following fail, we don't have any resources for 637 - // hot plug add 632 + /* If all of the following fail, we don't have any resources for 633 + * hot plug add 634 + */ 638 635 rc = 1; 639 636 rc &= cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); 640 637 rc &= cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head));
+173 -140
drivers/pci/hotplug/cpqphp_pci.c
··· 178 178 if (!rc) 179 179 return !rc; 180 180 181 - // set the Edge Level Control Register (ELCR) 181 + /* set the Edge Level Control Register (ELCR) */ 182 182 temp_word = inb(0x4d0); 183 183 temp_word |= inb(0x4d1) << 8; 184 184 185 185 temp_word |= 0x01 << irq_num; 186 186 187 - // This should only be for x86 as it sets the Edge Level Control Register 188 - outb((u8) (temp_word & 0xFF), 0x4d0); 189 - outb((u8) ((temp_word & 0xFF00) >> 8), 0x4d1); 190 - rc = 0; 191 - } 187 + /* This should only be for x86 as it sets the Edge Level 188 + * Control Register 189 + */ 190 + outb((u8) (temp_word & 0xFF), 0x4d0); outb((u8) ((temp_word & 191 + 0xFF00) >> 8), 0x4d1); rc = 0; } 192 192 193 193 return rc; 194 194 } ··· 213 213 ctrl->pci_bus->number = bus_num; 214 214 215 215 for (tdevice = 0; tdevice < 0xFF; tdevice++) { 216 - //Scan for access first 216 + /* Scan for access first */ 217 217 if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1) 218 218 continue; 219 219 dbg("Looking for nonbridge bus_num %d dev_num %d\n", bus_num, tdevice); 220 - //Yep we got one. Not a bridge ? 220 + /* Yep we got one. Not a bridge ? */ 221 221 if ((work >> 8) != PCI_TO_PCI_BRIDGE_CLASS) { 222 222 *dev_num = tdevice; 223 223 dbg("found it !\n"); ··· 225 225 } 226 226 } 227 227 for (tdevice = 0; tdevice < 0xFF; tdevice++) { 228 - //Scan for access first 228 + /* Scan for access first */ 229 229 if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1) 230 230 continue; 231 231 dbg("Looking for bridge bus_num %d dev_num %d\n", bus_num, tdevice); 232 - //Yep we got one. bridge ? 232 + /* Yep we got one. bridge ? */ 233 233 if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) { 234 234 pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(tdevice, 0), PCI_SECONDARY_BUS, &tbus); 235 235 dbg("Recurse on bus_num %d tdevice %d\n", tbus, tdevice); ··· 257 257 258 258 len = (PCIIRQRoutingInfoLength->size - 259 259 sizeof(struct irq_routing_table)) / sizeof(struct irq_info); 260 - // Make sure I got at least one entry 260 + /* Make sure I got at least one entry */ 261 261 if (len == 0) { 262 262 kfree(PCIIRQRoutingInfoLength ); 263 263 return -1; ··· 304 304 305 305 int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 slot) 306 306 { 307 - return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0); //plain (bridges allowed) 307 + /* plain (bridges allowed) */ 308 + return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0); 308 309 } 309 310 310 311 311 - /* More PCI configuration routines; this time centered around hotplug controller */ 312 + /* More PCI configuration routines; this time centered around hotplug 313 + * controller 314 + */ 312 315 313 316 314 317 /* ··· 342 339 int stop_it; 343 340 int index; 344 341 345 - // Decide which slots are supported 342 + /* Decide which slots are supported */ 346 343 347 344 if (is_hot_plug) { 348 - //********************************* 349 - // is_hot_plug is the slot mask 350 - //********************************* 345 + /* 346 + * is_hot_plug is the slot mask 347 + */ 351 348 FirstSupported = is_hot_plug >> 4; 352 349 LastSupported = FirstSupported + (is_hot_plug & 0x0F) - 1; 353 350 } else { ··· 355 352 LastSupported = 0x1F; 356 353 } 357 354 358 - // Save PCI configuration space for all devices in supported slots 355 + /* Save PCI configuration space for all devices in supported slots */ 359 356 ctrl->pci_bus->number = busnumber; 360 357 for (device = FirstSupported; device <= LastSupported; device++) { 361 358 ID = 0xFFFFFFFF; 362 359 rc = pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID); 363 360 364 - if (ID != 0xFFFFFFFF) { // device in slot 361 + if (ID != 0xFFFFFFFF) { /* device in slot */ 365 362 rc = pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(device, 0), 0x0B, &class_code); 366 363 if (rc) 367 364 return rc; ··· 370 367 if (rc) 371 368 return rc; 372 369 373 - // If multi-function device, set max_functions to 8 370 + /* If multi-function device, set max_functions to 8 */ 374 371 if (header_type & 0x80) 375 372 max_functions = 8; 376 373 else ··· 380 377 381 378 do { 382 379 DevError = 0; 383 - 384 - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // P-P Bridge 385 - // Recurse the subordinate bus 386 - // get the subordinate bus number 380 + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { 381 + /* Recurse the subordinate bus 382 + * get the subordinate bus number 383 + */ 387 384 rc = pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(device, function), PCI_SECONDARY_BUS, &secondary_bus); 388 385 if (rc) { 389 386 return rc; 390 387 } else { 391 388 sub_bus = (int) secondary_bus; 392 389 393 - // Save secondary bus cfg spc 394 - // with this recursive call. 390 + /* Save secondary bus cfg spc 391 + * with this recursive call. 392 + */ 395 393 rc = cpqhp_save_config(ctrl, sub_bus, 0); 396 394 if (rc) 397 395 return rc; ··· 407 403 new_slot = cpqhp_slot_find(busnumber, device, index++); 408 404 409 405 if (!new_slot) { 410 - // Setup slot structure. 406 + /* Setup slot structure. */ 411 407 new_slot = cpqhp_slot_create(busnumber); 412 408 413 409 if (new_slot == NULL) ··· 419 415 new_slot->function = (u8) function; 420 416 new_slot->is_a_board = 1; 421 417 new_slot->switch_save = 0x10; 422 - // In case of unsupported board 418 + /* In case of unsupported board */ 423 419 new_slot->status = DevError; 424 420 new_slot->pci_dev = pci_find_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function); 425 421 ··· 433 429 434 430 stop_it = 0; 435 431 436 - // this loop skips to the next present function 437 - // reading in Class Code and Header type. 432 + /* this loop skips to the next present function 433 + * reading in Class Code and Header type. 434 + */ 438 435 439 436 while ((function < max_functions)&&(!stop_it)) { 440 437 rc = pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(device, function), PCI_VENDOR_ID, &ID); 441 - if (ID == 0xFFFFFFFF) { // nothing there. 438 + if (ID == 0xFFFFFFFF) { /* nothing there. */ 442 439 function++; 443 - } else { // Something there 440 + } else { /* Something there */ 444 441 rc = pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(device, function), 0x0B, &class_code); 445 442 if (rc) 446 443 return rc; ··· 455 450 } 456 451 457 452 } while (function < max_functions); 458 - } // End of IF (device in slot?) 453 + } /* End of IF (device in slot?) */ 459 454 else if (is_hot_plug) { 460 - // Setup slot structure with entry for empty slot 455 + /* Setup slot structure with entry for empty slot */ 461 456 new_slot = cpqhp_slot_create(busnumber); 462 457 463 458 if (new_slot == NULL) { ··· 471 466 new_slot->presence_save = 0; 472 467 new_slot->switch_save = 0; 473 468 } 474 - } // End of FOR loop 469 + } /* End of FOR loop */ 475 470 476 471 return(0); 477 472 } ··· 503 498 ctrl->pci_bus->number = new_slot->bus; 504 499 pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID); 505 500 506 - if (ID != 0xFFFFFFFF) { // device in slot 501 + if (ID != 0xFFFFFFFF) { /* device in slot */ 507 502 pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code); 508 503 pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type); 509 504 510 - if (header_type & 0x80) // Multi-function device 505 + if (header_type & 0x80) /* Multi-function device */ 511 506 max_functions = 8; 512 507 else 513 508 max_functions = 1; ··· 515 510 function = 0; 516 511 517 512 do { 518 - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge 519 - // Recurse the subordinate bus 513 + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { 514 + /* Recurse the subordinate bus */ 520 515 pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus); 521 516 522 517 sub_bus = (int) secondary_bus; 523 518 524 - // Save the config headers for the secondary bus. 519 + /* Save the config headers for the secondary 520 + * bus. 521 + */ 525 522 rc = cpqhp_save_config(ctrl, sub_bus, 0); 526 523 if (rc) 527 524 return(rc); 528 525 ctrl->pci_bus->number = new_slot->bus; 529 526 530 - } // End of IF 527 + } /* End of IF */ 531 528 532 529 new_slot->status = 0; 533 530 ··· 541 534 542 535 stop_it = 0; 543 536 544 - // this loop skips to the next present function 545 - // reading in the Class Code and the Header type. 546 - 537 + /* this loop skips to the next present function 538 + * reading in the Class Code and the Header type. 539 + */ 547 540 while ((function < max_functions) && (!stop_it)) { 548 541 pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID); 549 542 550 - if (ID == 0xFFFFFFFF) { // nothing there. 543 + if (ID == 0xFFFFFFFF) { /* nothing there. */ 551 544 function++; 552 - } else { // Something there 545 + } else { /* Something there */ 553 546 pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code); 554 547 555 548 pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, &header_type); ··· 559 552 } 560 553 561 554 } while (function < max_functions); 562 - } // End of IF (device in slot?) 555 + } /* End of IF (device in slot?) */ 563 556 else { 564 557 return 2; 565 558 } ··· 597 590 pci_bus->number = func->bus; 598 591 devfn = PCI_DEVFN(func->device, func->function); 599 592 600 - // Check for Bridge 593 + /* Check for Bridge */ 601 594 pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); 602 595 603 596 if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { 604 - // PCI-PCI Bridge 605 597 pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); 606 598 607 599 sub_bus = (int) secondary_bus; ··· 616 610 } 617 611 pci_bus->number = func->bus; 618 612 619 - //FIXME: this loop is duplicated in the non-bridge case. The two could be rolled together 620 - // Figure out IO and memory base lengths 613 + /* FIXME: this loop is duplicated in the non-bridge 614 + * case. The two could be rolled together Figure out 615 + * IO and memory base lengths 616 + */ 621 617 for (cloop = 0x10; cloop <= 0x14; cloop += 4) { 622 618 temp_register = 0xFFFFFFFF; 623 619 pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); 624 620 pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); 625 - 626 - if (base) { // If this register is implemented 621 + /* If this register is implemented */ 622 + if (base) { 627 623 if (base & 0x01L) { 628 - // IO base 629 - // set base = amount of IO space requested 624 + /* IO base 625 + * set base = amount of IO space 626 + * requested 627 + */ 630 628 base = base & 0xFFFFFFFE; 631 629 base = (~base) + 1; 632 630 633 631 type = 1; 634 632 } else { 635 - // memory base 633 + /* memory base */ 636 634 base = base & 0xFFFFFFF0; 637 635 base = (~base) + 1; 638 636 ··· 647 637 type = 0; 648 638 } 649 639 650 - // Save information in slot structure 640 + /* Save information in slot structure */ 651 641 func->base_length[(cloop - 0x10) >> 2] = 652 642 base; 653 643 func->base_type[(cloop - 0x10) >> 2] = type; 654 644 655 - } // End of base register loop 645 + } /* End of base register loop */ 656 646 657 - 658 - } else if ((header_type & 0x7F) == 0x00) { // PCI-PCI Bridge 659 - // Figure out IO and memory base lengths 647 + } else if ((header_type & 0x7F) == 0x00) { 648 + /* Figure out IO and memory base lengths */ 660 649 for (cloop = 0x10; cloop <= 0x24; cloop += 4) { 661 650 temp_register = 0xFFFFFFFF; 662 651 pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); 663 652 pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); 664 653 665 - if (base) { // If this register is implemented 654 + /* If this register is implemented */ 655 + if (base) { 666 656 if (base & 0x01L) { 667 - // IO base 668 - // base = amount of IO space requested 657 + /* IO base 658 + * base = amount of IO space 659 + * requested 660 + */ 669 661 base = base & 0xFFFFFFFE; 670 662 base = (~base) + 1; 671 663 672 664 type = 1; 673 665 } else { 674 - // memory base 675 - // base = amount of memory space requested 666 + /* memory base 667 + * base = amount of memory 668 + * space requested 669 + */ 676 670 base = base & 0xFFFFFFF0; 677 671 base = (~base) + 1; 678 672 ··· 687 673 type = 0; 688 674 } 689 675 690 - // Save information in slot structure 676 + /* Save information in slot structure */ 691 677 func->base_length[(cloop - 0x10) >> 2] = base; 692 678 func->base_type[(cloop - 0x10) >> 2] = type; 693 679 694 - } // End of base register loop 680 + } /* End of base register loop */ 695 681 696 - } else { // Some other unknown header type 682 + } else { /* Some other unknown header type */ 697 683 } 698 684 699 - // find the next device in this slot 685 + /* find the next device in this slot */ 700 686 func = cpqhp_slot_find(func->bus, func->device, index++); 701 687 } 702 688 ··· 742 728 pci_bus->number = func->bus; 743 729 devfn = PCI_DEVFN(func->device, func->function); 744 730 745 - // Save the command register 731 + /* Save the command register */ 746 732 pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command); 747 733 748 - // disable card 734 + /* disable card */ 749 735 command = 0x00; 750 736 pci_bus_write_config_word(pci_bus, devfn, PCI_COMMAND, command); 751 737 752 - // Check for Bridge 738 + /* Check for Bridge */ 753 739 pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type); 754 740 755 - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge 756 - // Clear Bridge Control Register 741 + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { 742 + /* Clear Bridge Control Register */ 757 743 command = 0x00; 758 744 pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command); 759 745 pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); ··· 769 755 bus_node->next = func->bus_head; 770 756 func->bus_head = bus_node; 771 757 772 - // Save IO base and Limit registers 758 + /* Save IO base and Limit registers */ 773 759 pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &b_base); 774 760 pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &b_length); 775 761 ··· 785 771 func->io_head = io_node; 786 772 } 787 773 788 - // Save memory base and Limit registers 774 + /* Save memory base and Limit registers */ 789 775 pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base); 790 776 pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); 791 777 ··· 801 787 func->mem_head = mem_node; 802 788 } 803 789 804 - // Save prefetchable memory base and Limit registers 790 + /* Save prefetchable memory base and Limit registers */ 805 791 pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); 806 792 pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); 807 793 ··· 816 802 p_mem_node->next = func->p_mem_head; 817 803 func->p_mem_head = p_mem_node; 818 804 } 819 - // Figure out IO and memory base lengths 805 + /* Figure out IO and memory base lengths */ 820 806 for (cloop = 0x10; cloop <= 0x14; cloop += 4) { 821 807 pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); 822 808 ··· 826 812 827 813 temp_register = base; 828 814 829 - if (base) { // If this register is implemented 815 + /* If this register is implemented */ 816 + if (base) { 830 817 if (((base & 0x03L) == 0x01) 831 818 && (save_command & 0x01)) { 832 - // IO base 833 - // set temp_register = amount of IO space requested 819 + /* IO base 820 + * set temp_register = amount 821 + * of IO space requested 822 + */ 834 823 temp_register = base & 0xFFFFFFFE; 835 824 temp_register = (~temp_register) + 1; 836 825 ··· 851 834 } else 852 835 if (((base & 0x0BL) == 0x08) 853 836 && (save_command & 0x02)) { 854 - // prefetchable memory base 837 + /* prefetchable memory base */ 855 838 temp_register = base & 0xFFFFFFF0; 856 839 temp_register = (~temp_register) + 1; 857 840 ··· 868 851 } else 869 852 if (((base & 0x0BL) == 0x00) 870 853 && (save_command & 0x02)) { 871 - // prefetchable memory base 854 + /* prefetchable memory base */ 872 855 temp_register = base & 0xFFFFFFF0; 873 856 temp_register = (~temp_register) + 1; 874 857 ··· 885 868 } else 886 869 return(1); 887 870 } 888 - } // End of base register loop 889 - } else if ((header_type & 0x7F) == 0x00) { // Standard header 890 - // Figure out IO and memory base lengths 871 + } /* End of base register loop */ 872 + /* Standard header */ 873 + } else if ((header_type & 0x7F) == 0x00) { 874 + /* Figure out IO and memory base lengths */ 891 875 for (cloop = 0x10; cloop <= 0x24; cloop += 4) { 892 876 pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base); 893 877 ··· 898 880 899 881 temp_register = base; 900 882 901 - if (base) { // If this register is implemented 883 + /* If this register is implemented */ 884 + if (base) { 902 885 if (((base & 0x03L) == 0x01) 903 886 && (save_command & 0x01)) { 904 - // IO base 905 - // set temp_register = amount of IO space requested 887 + /* IO base 888 + * set temp_register = amount 889 + * of IO space requested 890 + */ 906 891 temp_register = base & 0xFFFFFFFE; 907 892 temp_register = (~temp_register) + 1; 908 893 ··· 922 901 } else 923 902 if (((base & 0x0BL) == 0x08) 924 903 && (save_command & 0x02)) { 925 - // prefetchable memory base 904 + /* prefetchable memory base */ 926 905 temp_register = base & 0xFFFFFFF0; 927 906 temp_register = (~temp_register) + 1; 928 907 ··· 939 918 } else 940 919 if (((base & 0x0BL) == 0x00) 941 920 && (save_command & 0x02)) { 942 - // prefetchable memory base 921 + /* prefetchable memory base */ 943 922 temp_register = base & 0xFFFFFFF0; 944 923 temp_register = (~temp_register) + 1; 945 924 ··· 956 935 } else 957 936 return(1); 958 937 } 959 - } // End of base register loop 960 - } else { // Some other unknown header type 938 + } /* End of base register loop */ 939 + /* Some other unknown header type */ 940 + } else { 961 941 } 962 942 963 - // find the next device in this slot 943 + /* find the next device in this slot */ 964 944 func = cpqhp_slot_find(func->bus, func->device, index++); 965 945 } 966 946 ··· 997 975 pci_bus->number = func->bus; 998 976 devfn = PCI_DEVFN(func->device, func->function); 999 977 1000 - // Start at the top of config space so that the control 1001 - // registers are programmed last 978 + /* Start at the top of config space so that the control 979 + * registers are programmed last 980 + */ 1002 981 for (cloop = 0x3C; cloop > 0; cloop -= 4) { 1003 982 pci_bus_write_config_dword (pci_bus, devfn, cloop, func->config_space[cloop >> 2]); 1004 983 } 1005 984 1006 985 pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); 1007 986 1008 - // If this is a bridge device, restore subordinate devices 1009 - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge 987 + /* If this is a bridge device, restore subordinate devices */ 988 + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { 1010 989 pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); 1011 990 1012 991 sub_bus = (int) secondary_bus; ··· 1023 1000 } 1024 1001 } else { 1025 1002 1026 - // Check all the base Address Registers to make sure 1027 - // they are the same. If not, the board is different. 1003 + /* Check all the base Address Registers to make sure 1004 + * they are the same. If not, the board is different. 1005 + */ 1028 1006 1029 1007 for (cloop = 16; cloop < 40; cloop += 4) { 1030 1008 pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp); ··· 1082 1058 1083 1059 pci_bus_read_config_dword (pci_bus, devfn, PCI_VENDOR_ID, &temp_register); 1084 1060 1085 - // No adapter present 1061 + /* No adapter present */ 1086 1062 if (temp_register == 0xFFFFFFFF) 1087 1063 return(NO_ADAPTER_PRESENT); 1088 1064 1089 1065 if (temp_register != func->config_space[0]) 1090 1066 return(ADAPTER_NOT_SAME); 1091 1067 1092 - // Check for same revision number and class code 1068 + /* Check for same revision number and class code */ 1093 1069 pci_bus_read_config_dword (pci_bus, devfn, PCI_CLASS_REVISION, &temp_register); 1094 1070 1095 - // Adapter not the same 1071 + /* Adapter not the same */ 1096 1072 if (temp_register != func->config_space[0x08 >> 2]) 1097 1073 return(ADAPTER_NOT_SAME); 1098 1074 1099 - // Check for Bridge 1075 + /* Check for Bridge */ 1100 1076 pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); 1101 1077 1102 - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge 1103 - // In order to continue checking, we must program the 1104 - // bus registers in the bridge to respond to accesses 1105 - // for it's subordinate bus(es) 1078 + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { 1079 + /* In order to continue checking, we must program the 1080 + * bus registers in the bridge to respond to accesses 1081 + * for its subordinate bus(es) 1082 + */ 1106 1083 1107 1084 temp_register = func->config_space[0x18 >> 2]; 1108 1085 pci_bus_write_config_dword (pci_bus, devfn, PCI_PRIMARY_BUS, temp_register); ··· 1121 1096 } 1122 1097 1123 1098 } 1124 - // Check to see if it is a standard config header 1099 + /* Check to see if it is a standard config header */ 1125 1100 else if ((header_type & 0x7F) == PCI_HEADER_TYPE_NORMAL) { 1126 - // Check subsystem vendor and ID 1101 + /* Check subsystem vendor and ID */ 1127 1102 pci_bus_read_config_dword (pci_bus, devfn, PCI_SUBSYSTEM_VENDOR_ID, &temp_register); 1128 1103 1129 1104 if (temp_register != func->config_space[0x2C >> 2]) { 1130 - // If it's a SMART-2 and the register isn't filled 1131 - // in, ignore the difference because 1132 - // they just have an old rev of the firmware 1133 - 1105 + /* If it's a SMART-2 and the register isn't 1106 + * filled in, ignore the difference because 1107 + * they just have an old rev of the firmware 1108 + */ 1134 1109 if (!((func->config_space[0] == 0xAE100E11) 1135 1110 && (temp_register == 0x00L))) 1136 1111 return(ADAPTER_NOT_SAME); 1137 1112 } 1138 - // Figure out IO and memory base lengths 1113 + /* Figure out IO and memory base lengths */ 1139 1114 for (cloop = 0x10; cloop <= 0x24; cloop += 4) { 1140 1115 temp_register = 0xFFFFFFFF; 1141 1116 pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); 1142 1117 pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); 1143 - if (base) { // If this register is implemented 1118 + 1119 + /* If this register is implemented */ 1120 + if (base) { 1144 1121 if (base & 0x01L) { 1145 - // IO base 1146 - // set base = amount of IO space requested 1122 + /* IO base 1123 + * set base = amount of IO 1124 + * space requested 1125 + */ 1147 1126 base = base & 0xFFFFFFFE; 1148 1127 base = (~base) + 1; 1149 1128 1150 1129 type = 1; 1151 1130 } else { 1152 - // memory base 1131 + /* memory base */ 1153 1132 base = base & 0xFFFFFFF0; 1154 1133 base = (~base) + 1; 1155 1134 ··· 1164 1135 type = 0; 1165 1136 } 1166 1137 1167 - // Check information in slot structure 1138 + /* Check information in slot structure */ 1168 1139 if (func->base_length[(cloop - 0x10) >> 2] != base) 1169 1140 return(ADAPTER_NOT_SAME); 1170 1141 1171 1142 if (func->base_type[(cloop - 0x10) >> 2] != type) 1172 1143 return(ADAPTER_NOT_SAME); 1173 1144 1174 - } // End of base register loop 1145 + } /* End of base register loop */ 1175 1146 1176 - } // End of (type 0 config space) else 1147 + } /* End of (type 0 config space) else */ 1177 1148 else { 1178 - // this is not a type 0 or 1 config space header so 1179 - // we don't know how to do it 1149 + /* this is not a type 0 or 1 config space header so 1150 + * we don't know how to do it 1151 + */ 1180 1152 return(DEVICE_TYPE_NOT_SUPPORTED); 1181 1153 } 1182 1154 1183 - // Get the next function 1155 + /* Get the next function */ 1184 1156 func = cpqhp_slot_find(func->bus, func->device, index++); 1185 1157 } 1186 1158 ··· 1220 1190 if (rom_resource_table == NULL) { 1221 1191 return -ENODEV; 1222 1192 } 1223 - // Sum all resources and setup resource maps 1193 + /* Sum all resources and setup resource maps */ 1224 1194 unused_IRQ = readl(rom_resource_table + UNUSED_IRQ); 1225 1195 dbg("unused_IRQ = %x\n", unused_IRQ); 1226 1196 ··· 1292 1262 dev_func, io_base, io_length, mem_base, mem_length, pre_mem_base, pre_mem_length, 1293 1263 primary_bus, secondary_bus, max_bus); 1294 1264 1295 - // If this entry isn't for our controller's bus, ignore it 1265 + /* If this entry isn't for our controller's bus, ignore it */ 1296 1266 if (primary_bus != ctrl->bus) { 1297 1267 i--; 1298 1268 one_slot += sizeof (struct slot_rt); 1299 1269 continue; 1300 1270 } 1301 - // find out if this entry is for an occupied slot 1271 + /* find out if this entry is for an occupied slot */ 1302 1272 ctrl->pci_bus->number = primary_bus; 1303 1273 pci_bus_read_config_dword (ctrl->pci_bus, dev_func, PCI_VENDOR_ID, &temp_dword); 1304 1274 dbg("temp_D_word = %x\n", temp_dword); ··· 1312 1282 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); 1313 1283 } 1314 1284 1315 - // If we can't find a match, skip this table entry 1285 + /* If we can't find a match, skip this table entry */ 1316 1286 if (!func) { 1317 1287 i--; 1318 1288 one_slot += sizeof (struct slot_rt); 1319 1289 continue; 1320 1290 } 1321 - // this may not work and shouldn't be used 1291 + /* this may not work and shouldn't be used */ 1322 1292 if (secondary_bus != primary_bus) 1323 1293 bridged_slot = 1; 1324 1294 else ··· 1331 1301 } 1332 1302 1333 1303 1334 - // If we've got a valid IO base, use it 1304 + /* If we've got a valid IO base, use it */ 1335 1305 1336 1306 temp_dword = io_base + io_length; 1337 1307 ··· 1355 1325 } 1356 1326 } 1357 1327 1358 - // If we've got a valid memory base, use it 1328 + /* If we've got a valid memory base, use it */ 1359 1329 temp_dword = mem_base + mem_length; 1360 1330 if ((mem_base) && (temp_dword < 0x10000)) { 1361 1331 mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL); ··· 1378 1348 } 1379 1349 } 1380 1350 1381 - // If we've got a valid prefetchable memory base, and 1382 - // the base + length isn't greater than 0xFFFF 1351 + /* If we've got a valid prefetchable memory base, and 1352 + * the base + length isn't greater than 0xFFFF 1353 + */ 1383 1354 temp_dword = pre_mem_base + pre_mem_length; 1384 1355 if ((pre_mem_base) && (temp_dword < 0x10000)) { 1385 1356 p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL); ··· 1403 1372 } 1404 1373 } 1405 1374 1406 - // If we've got a valid bus number, use it 1407 - // The second condition is to ignore bus numbers on 1408 - // populated slots that don't have PCI-PCI bridges 1375 + /* If we've got a valid bus number, use it 1376 + * The second condition is to ignore bus numbers on 1377 + * populated slots that don't have PCI-PCI bridges 1378 + */ 1409 1379 if (secondary_bus && (secondary_bus != primary_bus)) { 1410 1380 bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL); 1411 1381 if (!bus_node) ··· 1430 1398 one_slot += sizeof (struct slot_rt); 1431 1399 } 1432 1400 1433 - // If all of the following fail, we don't have any resources for 1434 - // hot plug add 1401 + /* If all of the following fail, we don't have any resources for 1402 + * hot plug add 1403 + */ 1435 1404 rc = 1; 1436 1405 rc &= cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); 1437 1406 rc &= cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head));