From patchwork Sat Jun 20 23:11:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Grundler X-Patchwork-Id: 31627 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5KNC8dx013985 for ; Sat, 20 Jun 2009 23:12:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbZFTXLt (ORCPT ); Sat, 20 Jun 2009 19:11:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751370AbZFTXLt (ORCPT ); Sat, 20 Jun 2009 19:11:49 -0400 Received: from complete.lackof.org ([198.49.126.79]:48114 "EHLO complete.lackof.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbZFTXLs (ORCPT ); Sat, 20 Jun 2009 19:11:48 -0400 Received: from localhost (localhost [127.0.0.1]) by complete.lackof.org (Postfix) with ESMTP id 7C83C33E005A; Sat, 20 Jun 2009 17:11:51 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at lackof.org Received: from complete.lackof.org ([127.0.0.1]) by localhost (complete.lackof.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nf7Q8zv+orjh; Sat, 20 Jun 2009 17:11:51 -0600 (MDT) Received: by complete.lackof.org (Postfix, from userid 27253) id 1E1FC33E0066; Sat, 20 Jun 2009 17:11:51 -0600 (MDT) Date: Sat, 20 Jun 2009 17:11:51 -0600 From: Grant Grundler To: Kyle McMartin , Helge Deller Cc: linux-parisc@vger.kernel.org Subject: Re: [PATCH][linux-2.6] Fix gcc 4.4 warning in lba_pci.c Message-ID: <20090620231151.GA21477@lackof.org> References: <20090620224613.GB853@lackof.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090620224613.GB853@lackof.org> X-Home-Page: http://www.parisc-linux.org/ User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Sat, Jun 20, 2009 at 04:46:13PM -0600, Grant Grundler wrote: > 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". Take 2. Per Kyle's request (offlist), use kzalloc instead since it's not ever used again after boot. Signed-off-by: Grant Grundler ---- Not tested! Need to fix other b0rkage before I can test. And feel free to use either version of this patch. Both are trivial. --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 59fbbf1..6585c29 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -980,28 +980,38 @@ static void lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) { unsigned long bytecnt; - pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */ - pdc_pat_cell_mod_maddr_block_t io_pdc_cell; /* IO_VIEW */ long io_count; long status; /* PDC return status */ long pa_count; + pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; /* PA_VIEW */ + pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */ int i; + pa_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t)); + if (!pa_pdc_cell) + return; + + io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t)); + if (!pa_pdc_cell) { + kfree(pa_pdc_cell); + return; + } + /* return cell module (IO view) */ status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, - PA_VIEW, & pa_pdc_cell); - pa_count = pa_pdc_cell.mod[1]; + PA_VIEW, pa_pdc_cell); + pa_count = pa_pdc_cell->mod[1]; status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, - IO_VIEW, &io_pdc_cell); - io_count = io_pdc_cell.mod[1]; + IO_VIEW, io_pdc_cell); + io_count = io_pdc_cell->mod[1]; /* We've already done this once for device discovery...*/ if (status != PDC_OK) { panic("pdc_pat_cell_module() call failed for LBA!\n"); } - if (PAT_GET_ENTITY(pa_pdc_cell.mod_info) != PAT_ENTITY_LBA) { + if (PAT_GET_ENTITY(pa_pdc_cell->mod_info) != PAT_ENTITY_LBA) { panic("pdc_pat_cell_module() entity returned != PAT_ENTITY_LBA!\n"); } @@ -1016,8 +1026,8 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) } *p, *io; struct resource *r; - p = (void *) &(pa_pdc_cell.mod[2+i*3]); - io = (void *) &(io_pdc_cell.mod[2+i*3]); + p = (void *) &(pa_pdc_cell->mod[2+i*3]); + io = (void *) &(io_pdc_cell->mod[2+i*3]); /* Convert the PAT range data to PCI "struct resource" */ switch(p->type & 0xff) {