Commit e957f608f321a97a60d065bccd01949590eef52e

Authored by Grant Grundler
Committed by Kyle McMartin
1 parent ebc30a0f67

parisc: Fix gcc 4.4 warning in lba_pci.c

gcc 4.4 warns about:
drivers/parisc/lba_pci.c: In function 'lba_pat_resources':
drivers/parisc/lba_pci.c:1099: warning: the frame size of 8280 bytes is larger than 4096 bytes

The problem is we declare two large structures on the stack. They don't need
to be on the stack since they are only used during LBA initialization (which
is serialized). Moving to be "static".

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>

Showing 1 changed file with 22 additions and 9 deletions Side-by-side Diff

drivers/parisc/lba_pci.c
... ... @@ -980,28 +980,38 @@
980 980 lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
981 981 {
982 982 unsigned long bytecnt;
983   - pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */
984   - pdc_pat_cell_mod_maddr_block_t io_pdc_cell; /* IO_VIEW */
985 983 long io_count;
986 984 long status; /* PDC return status */
987 985 long pa_count;
  986 + pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; /* PA_VIEW */
  987 + pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */
988 988 int i;
989 989  
  990 + pa_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
  991 + if (!pa_pdc_cell)
  992 + return;
  993 +
  994 + io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
  995 + if (!pa_pdc_cell) {
  996 + kfree(pa_pdc_cell);
  997 + return;
  998 + }
  999 +
990 1000 /* return cell module (IO view) */
991 1001 status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index,
992   - PA_VIEW, & pa_pdc_cell);
993   - pa_count = pa_pdc_cell.mod[1];
  1002 + PA_VIEW, pa_pdc_cell);
  1003 + pa_count = pa_pdc_cell->mod[1];
994 1004  
995 1005 status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index,
996   - IO_VIEW, &io_pdc_cell);
997   - io_count = io_pdc_cell.mod[1];
  1006 + IO_VIEW, io_pdc_cell);
  1007 + io_count = io_pdc_cell->mod[1];
998 1008  
999 1009 /* We've already done this once for device discovery...*/
1000 1010 if (status != PDC_OK) {
1001 1011 panic("pdc_pat_cell_module() call failed for LBA!\n");
1002 1012 }
1003 1013  
1004   - if (PAT_GET_ENTITY(pa_pdc_cell.mod_info) != PAT_ENTITY_LBA) {
  1014 + if (PAT_GET_ENTITY(pa_pdc_cell->mod_info) != PAT_ENTITY_LBA) {
1005 1015 panic("pdc_pat_cell_module() entity returned != PAT_ENTITY_LBA!\n");
1006 1016 }
1007 1017  
... ... @@ -1016,8 +1026,8 @@
1016 1026 } *p, *io;
1017 1027 struct resource *r;
1018 1028  
1019   - p = (void *) &(pa_pdc_cell.mod[2+i*3]);
1020   - io = (void *) &(io_pdc_cell.mod[2+i*3]);
  1029 + p = (void *) &(pa_pdc_cell->mod[2+i*3]);
  1030 + io = (void *) &(io_pdc_cell->mod[2+i*3]);
1021 1031  
1022 1032 /* Convert the PAT range data to PCI "struct resource" */
1023 1033 switch(p->type & 0xff) {
... ... @@ -1096,6 +1106,9 @@
1096 1106 break;
1097 1107 }
1098 1108 }
  1109 +
  1110 + kfree(pa_pdc_cell);
  1111 + kfree(io_pdc_cell);
1099 1112 }
1100 1113 #else
1101 1114 /* keep compiler from complaining about missing declarations */