Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbdHBIUm (ORCPT ); Wed, 2 Aug 2017 04:20:42 -0400 Received: from mailout01.webmailer.hosteurope.de ([80.237.138.57]:59529 "EHLO mailout01.webmailer.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752214AbdHBIUl (ORCPT ); Wed, 2 Aug 2017 04:20:41 -0400 X-Squirrel-UserHash: EhVcX1pHQwdXWkQFBhENSgEKLlwACw== X-Squirrel-FromHash: UwFaC1lCF1E= Message-ID: <5745d39bff62cf78ceade37cfb85adbd-EhVcX1pHQwdXWkQFBhENSgEKLlwACzJXX19HAVhEWENbS1kLMF52CEtUX1pBSEwcXlJRL1lQWAlZWXQBVl0=-webmailer1@server03.webmailer.webmailer.hosteurope.de> In-Reply-To: <20170731085812.361318-1-arnd@arndb.de> References: <20170731085812.361318-1-arnd@arndb.de> Date: Wed, 2 Aug 2017 10:20:38 +0200 Subject: Re: [PATCH] staging: pi433: reduce stack size in tx thread From: "Wolf Entwicklungen" To: "Arnd Bergmann" Cc: "Greg Kroah-Hartman" , "Marcus Wolf" , "Arnd Bergmann" , "Joseph Wright" , "dan.carpenter@oracle.com" , "Derek Robson" , "Colin Ian King" , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Reply-To: Marcus.Wolf@Wolf-Entwicklungen.de User-Agent: Host Europe Webmailer/1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Priority: 3 (Normal) Importance: Normal X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, license restriction X-KLMS-AntiPhishing: not scanned, license restriction X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2017/08/02 01:57:00 #10257287; khse: 2015-01-01 01:01:01 X-KLMS-AntiVirus-Status: Clean, skipped X-HE-Access: Yes X-bounce-key: webpack.hosteurope.de;marcus.wolf@wolf-entwicklungen.de;1501662038;1f93bee4; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1538 Lines: 49 Reviewed-by: Marcus Wolf Maybe tx_buffer is a bit more clearly then buffer. Thanks, Marcus Am Mo, 31.07.2017, 10:57 schrieb Arnd Bergmann: > Putting a 900 byte array on the stack is a clearly too much in the > kernel, and sometimes results in warnings like: > > drivers/staging/pi433/pi433_if.c: In function 'pi433_tx_thread': > drivers/staging/pi433/pi433_if.c:645:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > This moves the buffer into the dynamically allocated per-device > structure. > > Signed-off-by: Arnd Bergmann > --- > drivers/staging/pi433/pi433_if.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c > index ed737f4b1e77..ec9811ae4735 100644 > --- a/drivers/staging/pi433/pi433_if.c > +++ b/drivers/staging/pi433/pi433_if.c > @@ -92,6 +92,7 @@ struct pi433_device { > struct task_struct *tx_task_struct; > wait_queue_head_t tx_wait_queue; > u8 free_in_fifo; > + char buffer[MAX_MSG_SIZE]; > > /* rx related values */ > struct pi433_rx_cfg rx_cfg; > @@ -471,7 +472,7 @@ pi433_tx_thread(void *data) > struct pi433_device *device = data; > struct spi_device *spi = device->spi; /* needed for SET_CHECKED */ > struct pi433_tx_cfg tx_cfg; > - u8 buffer[MAX_MSG_SIZE]; > + u8 *buffer = device->buffer; > size_t size; > bool rx_interrupted = false; > int position, repetitions; > -- > 2.9.0 > > >