[PATCH 03/12] MIPS: PCI: Minor clean-ups to pci-legacy.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Joshua Kinard <kumba@xxxxxxxxxx>

Apply several minor clean-ups to arch/mips/pci/pci-legacy.c:
 - Collapse one-line comments to use a single /* ... */
 - Move 2nd arg to pci_add_resource_offset up a line
 - Put a pr_info message all on one line (checkpatch)
 - Replace several printk's with pr_info/pr_warn/pr_err
 - Add whitespace around operators in for loop and conditional

Signed-off-by: Joshua Kinard <kumba@xxxxxxxxxx>
---
 arch/mips/pci/pci-legacy.c | 48 ++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 27 deletions(-)

diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c
index 014649be158d..98f36ed8f7da 100644
--- a/arch/mips/pci/pci-legacy.c
+++ b/arch/mips/pci/pci-legacy.c
@@ -58,9 +58,7 @@ pcibios_align_resource(void *data, const struct resource *res,
 		if (start < PCIBIOS_MIN_IO + hose->io_resource->start)
 			start = PCIBIOS_MIN_IO + hose->io_resource->start;
 
-		/*
-		 * Put everything into 0x00-0xff region modulo 0x400
-		 */
+		/* Put everything into 0x00-0xff region modulo 0x400 */
 		if (start & 0x300)
 			start = (start + 0x3ff) & ~0x3ff;
 	} else if (res->flags & IORESOURCE_MEM) {
@@ -82,12 +80,12 @@ static void pcibios_scanbus(struct pci_controller *hose)
 	if (hose->get_busno && pci_has_flag(PCI_PROBE_ONLY))
 		next_busno = (*hose->get_busno)();
 
-	pci_add_resource_offset(&resources,
-				hose->mem_resource, hose->mem_offset);
-	pci_add_resource_offset(&resources,
-				hose->io_resource, hose->io_offset);
-	pci_add_resource_offset(&resources,
-				hose->busn_resource, hose->busn_offset);
+	pci_add_resource_offset(&resources, hose->mem_resource,
+				hose->mem_offset);
+	pci_add_resource_offset(&resources, hose->io_resource,
+				hose->io_offset);
+	pci_add_resource_offset(&resources, hose->busn_resource,
+				hose->busn_offset);
 	bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
 				&resources);
 	hose->bus = bus;
@@ -139,18 +137,16 @@ void pci_load_of_ranges(struct pci_controller *hose, struct device_node *node)
 
 		switch (range.flags & IORESOURCE_TYPE_BITS) {
 		case IORESOURCE_IO:
-			pr_info("  IO 0x%016llx..0x%016llx\n",
-				range.cpu_addr,
-				range.cpu_addr + range.size - 1);
+			pr_info("  IO 0x%016llx..0x%016llx\n", range.cpu_addr,
+				(range.cpu_addr + range.size - 1));
 			hose->io_map_base =
 				(unsigned long)ioremap(range.cpu_addr,
 						       range.size);
 			res = hose->io_resource;
 			break;
 		case IORESOURCE_MEM:
-			pr_info(" MEM 0x%016llx..0x%016llx\n",
-				range.cpu_addr,
-				range.cpu_addr + range.size - 1);
+			pr_info(" MEM 0x%016llx..0x%016llx\n", range.cpu_addr,
+				(range.cpu_addr + range.size - 1));
 			res = hose->mem_resource;
 			break;
 		}
@@ -195,10 +191,8 @@ void register_pci_controller(struct pci_controller *hose)
 	/*
 	 * Do not panic here but later - this might happen before console init.
 	 */
-	if (!hose->io_map_base) {
-		printk(KERN_WARNING
-		       "registering PCI controller with io_map_base unset\n");
-	}
+	if (!hose->io_map_base)
+		pr_warn("registering PCI controller with io_map_base unset\n");
 
 	/*
 	 * Scan the bus if it is register after the PCI subsystem
@@ -213,8 +207,7 @@ void register_pci_controller(struct pci_controller *hose)
 	return;
 
 out:
-	printk(KERN_WARNING
-	       "Skipping PCI bus scan due to resource conflict\n");
+	pr_warn("Skipping PCI bus scan due to resource conflict\n");
 }
 
 static int __init pcibios_init(void)
@@ -242,9 +235,9 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
 
 	pci_read_config_word(dev, PCI_COMMAND, &cmd);
 	old_cmd = cmd;
-	for (idx=0; idx < PCI_NUM_RESOURCES; idx++) {
+	for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
 		/* Only set up the requested stuff */
-		if (!(mask & (1<<idx)))
+		if (!(mask & (1 << idx)))
 			continue;
 
 		r = &dev->resource[idx];
@@ -254,8 +247,7 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
 				(!(r->flags & IORESOURCE_ROM_ENABLE)))
 			continue;
 		if (!r->start && r->end) {
-			printk(KERN_ERR "PCI: Device %s not available "
-			       "because of resource collisions\n",
+			pr_err("PCI: Device %s not available because of resource collisions\n",
 			       pci_name(dev));
 			return -EINVAL;
 		}
@@ -265,10 +257,11 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
 			cmd |= PCI_COMMAND_MEMORY;
 	}
 	if (cmd != old_cmd) {
-		printk("PCI: Enabling device %s (%04x -> %04x)\n",
-		       pci_name(dev), old_cmd, cmd);
+		pr_info("PCI: Enabling device %s (%04x -> %04x)\n",
+			pci_name(dev), old_cmd, cmd);
 		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
+
 	return 0;
 }
 
@@ -298,5 +291,6 @@ char *__init pcibios_setup(char *str)
 {
 	if (pcibios_plat_setup)
 		return pcibios_plat_setup(str);
+
 	return str;
 }
-- 
2.11.1





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux