]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/parisc/kernel/inventory.c
parisc: inventory.c, fix bloated stack frame
[net-next-2.6.git] / arch / parisc / kernel / inventory.c
index 4e847ba53180a0641d4cdebc848359f867160984..d228d823787991f138cea6651bbb6787701b7db5 100644 (file)
@@ -47,7 +47,7 @@ void __init setup_pdc(void)
        struct pdc_system_map_mod_info module_result;
        struct pdc_module_path module_path;
        struct pdc_model model;
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        struct pdc_pat_cell_num cell_info;
 #endif
 
@@ -73,7 +73,7 @@ void __init setup_pdc(void)
         * clearer message.
         */
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        status = pdc_pat_cell_get_number(&cell_info);
        if (status == PDC_OK) {
                pdc_type = PDC_TYPE_PAT;
@@ -152,7 +152,7 @@ static void __init pagezero_memconfig(void)
        npmem_ranges = 1;
 }
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
 
 /* All of the PDC PAT specific code is 64-bit only */
 
@@ -170,23 +170,27 @@ static void __init pagezero_memconfig(void)
 static int __init 
 pat_query_module(ulong pcell_loc, ulong mod_index)
 {
-       pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;
+       pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
        unsigned long bytecnt;
        unsigned long temp;     /* 64-bit scratch value */
        long status;            /* PDC return value status */
        struct parisc_device *dev;
 
+       pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);
+       if (!pa_pdc_cell)
+               panic("couldn't allocate memory for PDC_PAT_CELL!");
+
        /* return cell module (PA or Processor view) */
        status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
-                                    PA_VIEW, &pa_pdc_cell);
+                                    PA_VIEW, pa_pdc_cell);
 
        if (status != PDC_OK) {
                /* no more cell modules or error */
                return status;
        }
 
-       temp = pa_pdc_cell.cba;
-       dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path);
+       temp = pa_pdc_cell->cba;
+       dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path));
        if (!dev) {
                return PDC_OK;
        }
@@ -203,8 +207,8 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
 
        /* save generic info returned from the call */
        /* REVISIT: who is the consumer of this? not sure yet... */
-       dev->mod_info = pa_pdc_cell.mod_info;   /* pass to PAT_GET_ENTITY() */
-       dev->pmod_loc = pa_pdc_cell.mod_location;
+       dev->mod_info = pa_pdc_cell->mod_info;  /* pass to PAT_GET_ENTITY() */
+       dev->pmod_loc = pa_pdc_cell->mod_location;
 
        register_parisc_device(dev);    /* advertise device */
 
@@ -216,14 +220,14 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
 
        case PAT_ENTITY_PROC:
                printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n",
-                       pa_pdc_cell.mod[0]);
+                       pa_pdc_cell->mod[0]);
                break;
 
        case PAT_ENTITY_MEM:
                printk(KERN_DEBUG 
                        "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n",
-                       pa_pdc_cell.mod[0], pa_pdc_cell.mod[1], 
-                       pa_pdc_cell.mod[2]);
+                       pa_pdc_cell->mod[0], pa_pdc_cell->mod[1],
+                       pa_pdc_cell->mod[2]);
                break;
        case PAT_ENTITY_CA:
                printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc);
@@ -243,23 +247,26 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
  print_ranges:
                pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
                                    IO_VIEW, &io_pdc_cell);
-               printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell.mod[1]);
-               for (i = 0; i < pa_pdc_cell.mod[1]; i++) {
+               printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]);
+               for (i = 0; i < pa_pdc_cell->mod[1]; i++) {
                        printk(KERN_DEBUG 
                                "  PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 
-                               i, pa_pdc_cell.mod[2 + i * 3],  /* type */
-                               pa_pdc_cell.mod[3 + i * 3],     /* start */
-                               pa_pdc_cell.mod[4 + i * 3]);    /* finish (ie end) */
+                               i, pa_pdc_cell->mod[2 + i * 3], /* type */
+                               pa_pdc_cell->mod[3 + i * 3],    /* start */
+                               pa_pdc_cell->mod[4 + i * 3]);   /* finish (ie end) */
                        printk(KERN_DEBUG 
                                "  IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 
-                               i, io_pdc_cell.mod[2 + i * 3],  /* type */
-                               io_pdc_cell.mod[3 + i * 3],     /* start */
-                               io_pdc_cell.mod[4 + i * 3]);    /* finish (ie end) */
+                               i, io_pdc_cell->mod[2 + i * 3], /* type */
+                               io_pdc_cell->mod[3 + i * 3],    /* start */
+                               io_pdc_cell->mod[4 + i * 3]);   /* finish (ie end) */
                }
                printk(KERN_DEBUG "\n");
                break;
        }
 #endif /* DEBUG_PAT */
+
+       kfree(pa_pdc_cell);
+
        return PDC_OK;
 }
 
@@ -408,13 +415,13 @@ static void __init sprockets_memconfig(void)
        }
 }
 
-#else   /* !__LP64__ */
+#else   /* !CONFIG_64BIT */
 
 #define pat_inventory() do { } while (0)
 #define pat_memconfig() do { } while (0)
 #define sprockets_memconfig() pagezero_memconfig()
 
-#endif /* !__LP64__ */
+#endif /* !CONFIG_64BIT */
 
 
 #ifndef CONFIG_PA20
@@ -499,7 +506,7 @@ add_system_map_addresses(struct parisc_device *dev, int num_addrs,
        dev->addr = kmalloc(num_addrs * sizeof(unsigned long), GFP_KERNEL);
        if(!dev->addr) {
                printk(KERN_ERR "%s %s(): memory allocation failure\n",
-                      __FILE__, __FUNCTION__);
+                      __FILE__, __func__);
                return;
        }