]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
minios: Backport part of xen-unstable 18928:b33b745cd5ec to avoid nested functions.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 5 May 2009 12:40:44 +0000 (13:40 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 5 May 2009 12:40:44 +0000 (13:40 +0100)
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
extras/mini-os/kernel.c

index 877168c750ed9e8cc860304424ad5775559dbe23..ba27e64ef4549018f021bcb108ff2095c24dc012 100644 (file)
@@ -434,25 +434,25 @@ static void kbdfront_thread(void *p)
 
 static struct pcifront_dev *pci_dev;
 
-static void pcifront_thread(void *p)
+static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
 {
-    void print(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
-    {
-        unsigned int vendor, device, rev, class;
+    unsigned int vendor, device, rev, class;
 
-        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x00, 2, &vendor);
-        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x02, 2, &device);
-        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x08, 1, &rev);
-        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x0a, 2, &class);
+    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x00, 2, &vendor);
+    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x02, 2, &device);
+    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x08, 1, &rev);
+    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x0a, 2, &class);
 
-        printk("%04x:%02x:%02x.%02x %04x: %04x:%04x (rev %02x)\n", domain, bus, slot, fun, class, vendor, device, rev);
-    }
+    printk("%04x:%02x:%02x.%02x %04x: %04x:%04x (rev %02x)\n", domain, bus, slot, fun, class, vendor, device, rev);
+}
 
+static void pcifront_thread(void *p)
+{
     pci_dev = init_pcifront(NULL);
     if (!pci_dev)
         return;
     printk("PCI devices:\n");
-    pcifront_scan(pci_dev, print);
+    pcifront_scan(pci_dev, print_pcidev);
 }
 
 static void fs_thread(void *p)