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

powerpc: pci: use %pR for printing struct resource

Use %pR to simplify the debug code. This also make the debug info more
readable.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
[mpe: Unsplit multi-line printk strings]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Kevin Hao and committed by
Michael Ellerman
ae2a84b4 368857c1

+18 -54
+18 -54
arch/powerpc/kernel/pci-common.c
··· 823 823 (reg.start == 0 && !pci_has_flag(PCI_PROBE_ONLY))) { 824 824 /* Only print message if not re-assigning */ 825 825 if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC)) 826 - pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] " 827 - "is unassigned\n", 828 - pci_name(dev), i, 829 - (unsigned long long)res->start, 830 - (unsigned long long)res->end, 831 - (unsigned int)res->flags); 826 + pr_debug("PCI:%s Resource %d %pR is unassigned\n", 827 + pci_name(dev), i, res); 832 828 res->end -= res->start; 833 829 res->start = 0; 834 830 res->flags |= IORESOURCE_UNSET; 835 831 continue; 836 832 } 837 833 838 - pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]\n", 839 - pci_name(dev), i, 840 - (unsigned long long)res->start,\ 841 - (unsigned long long)res->end, 842 - (unsigned int)res->flags); 834 + pr_debug("PCI:%s Resource %d %pR\n", pci_name(dev), i, res); 843 835 } 844 836 845 837 /* Call machine specific resource fixup */ ··· 935 943 continue; 936 944 } 937 945 938 - pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x]\n", 939 - pci_name(dev), i, 940 - (unsigned long long)res->start,\ 941 - (unsigned long long)res->end, 942 - (unsigned int)res->flags); 946 + pr_debug("PCI:%s Bus rsrc %d %pR\n", pci_name(dev), i, res); 943 947 944 948 /* Try to detect uninitialized P2P bridge resources, 945 949 * and clear them out so they get re-assigned later ··· 1120 1132 *pp = NULL; 1121 1133 for (p = res->child; p != NULL; p = p->sibling) { 1122 1134 p->parent = res; 1123 - pr_debug("PCI: Reparented %s [%llx..%llx] under %s\n", 1124 - p->name, 1125 - (unsigned long long)p->start, 1126 - (unsigned long long)p->end, res->name); 1135 + pr_debug("PCI: Reparented %s %pR under %s\n", 1136 + p->name, p, res->name); 1127 1137 } 1128 1138 return 0; 1129 1139 } ··· 1190 1204 } 1191 1205 } 1192 1206 1193 - pr_debug("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx " 1194 - "[0x%x], parent %p (%s)\n", 1195 - bus->self ? pci_name(bus->self) : "PHB", 1196 - bus->number, i, 1197 - (unsigned long long)res->start, 1198 - (unsigned long long)res->end, 1199 - (unsigned int)res->flags, 1200 - pr, (pr && pr->name) ? pr->name : "nil"); 1207 + pr_debug("PCI: %s (bus %d) bridge rsrc %d: %pR, parent %p (%s)\n", 1208 + bus->self ? pci_name(bus->self) : "PHB", bus->number, 1209 + i, res, pr, (pr && pr->name) ? pr->name : "nil"); 1201 1210 1202 1211 if (pr && !(pr->flags & IORESOURCE_UNSET)) { 1203 1212 struct pci_dev *dev = bus->self; ··· 1234 1253 { 1235 1254 struct resource *pr, *r = &dev->resource[idx]; 1236 1255 1237 - pr_debug("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n", 1238 - pci_name(dev), idx, 1239 - (unsigned long long)r->start, 1240 - (unsigned long long)r->end, 1241 - (unsigned int)r->flags); 1256 + pr_debug("PCI: Allocating %s: Resource %d: %pR\n", 1257 + pci_name(dev), idx, r); 1242 1258 1243 1259 pr = pci_find_parent_resource(dev, r); 1244 1260 if (!pr || (pr->flags & IORESOURCE_UNSET) || ··· 1243 1265 printk(KERN_WARNING "PCI: Cannot allocate resource region %d" 1244 1266 " of device %s, will remap\n", idx, pci_name(dev)); 1245 1267 if (pr) 1246 - pr_debug("PCI: parent is %p: %016llx-%016llx [%x]\n", 1247 - pr, 1248 - (unsigned long long)pr->start, 1249 - (unsigned long long)pr->end, 1250 - (unsigned int)pr->flags); 1268 + pr_debug("PCI: parent is %p: %pR\n", pr, pr); 1251 1269 /* We'll assign a new address later */ 1252 1270 r->flags |= IORESOURCE_UNSET; 1253 1271 r->end -= r->start; ··· 1405 1431 if (r->parent || !r->start || !r->flags) 1406 1432 continue; 1407 1433 1408 - pr_debug("PCI: Claiming %s: " 1409 - "Resource %d: %016llx..%016llx [%x]\n", 1410 - pci_name(dev), i, 1411 - (unsigned long long)r->start, 1412 - (unsigned long long)r->end, 1413 - (unsigned int)r->flags); 1434 + pr_debug("PCI: Claiming %s: Resource %d: %pR\n", 1435 + pci_name(dev), i, r); 1414 1436 1415 1437 if (pci_claim_resource(dev, i) == 0) 1416 1438 continue; ··· 1490 1520 } else { 1491 1521 offset = pcibios_io_space_offset(hose); 1492 1522 1493 - pr_debug("PCI: PHB IO resource = %08llx-%08llx [%lx] off 0x%08llx\n", 1494 - (unsigned long long)res->start, 1495 - (unsigned long long)res->end, 1496 - (unsigned long)res->flags, 1497 - (unsigned long long)offset); 1523 + pr_debug("PCI: PHB IO resource = %pR off 0x%08llx\n", 1524 + res, (unsigned long long)offset); 1498 1525 pci_add_resource_offset(resources, res, offset); 1499 1526 } 1500 1527 ··· 1508 1541 offset = hose->mem_offset[i]; 1509 1542 1510 1543 1511 - pr_debug("PCI: PHB MEM resource %d = %08llx-%08llx [%lx] off 0x%08llx\n", i, 1512 - (unsigned long long)res->start, 1513 - (unsigned long long)res->end, 1514 - (unsigned long)res->flags, 1515 - (unsigned long long)offset); 1544 + pr_debug("PCI: PHB MEM resource %d = %pR off 0x%08llx\n", i, 1545 + res, (unsigned long long)offset); 1516 1546 1517 1547 pci_add_resource_offset(resources, res, offset); 1518 1548 }