Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832AbdGaI61 (ORCPT ); Mon, 31 Jul 2017 04:58:27 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:65039 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbdGaI60 (ORCPT ); Mon, 31 Jul 2017 04:58:26 -0400 From: Arnd Bergmann To: Greg Kroah-Hartman , Marcus Wolf Cc: Arnd Bergmann , Joseph Wright , "dan.carpenter@oracle.com" , Derek Robson , Colin Ian King , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: pi433: reduce stack size in tx thread Date: Mon, 31 Jul 2017 10:57:47 +0200 Message-Id: <20170731085812.361318-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:6aVxqXIpYqPxteNkY4J7RDE8U4KYX/WFyylJZw3ZhhPRtqnx2OW b8w6ULBwAOrs97XyNkGkP3b/yK6i04qiA2HEwnUCD0fGl/9AtiinfZBZMbTiqfM2n4yEh4x 4MlGakxJkyzXT8YXp/IbH+XDeqQmdlRqTWx528fPT1Z8aoreVhQAXJq/qc1M08SipqItuyT X1y3vcLRaAecSHbvmpB9Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:WkGhHYnK6Ww=:d80RVIbs7PGf/bGgyxiHkh bBqohZTyxCa/w07RvYQ8t+NDF3rx/bhZVwEPjqtcxIjWu0KkEXMG0N203rUh+qQOfNUao2WUb +V5/DVhCMi7L1rkbKuiQssa0Xbhz/i2BhvYsY/V9UcXqjF2vSC8pco9zIMn6o1RoBofjJCZQH +HDE0DIXpN8Lo3zcmzsWTH6mQWgki5nJRAezwG7gZnRwKMOK6pHsIaqqsGcg5HjUtMRb5VZ1P iQxBXnufJT74KiFHcVp+zHpNRsqXLAPewb63fg84LyPV7tssznUK+C3QnKA+3M08/4DcehJl0 UXQOW7+hQAOJXuHDVv33OenZtYkO+8OQZdxDG65bO0kcuTkNaskfDAFTyfhqViXlljyESMuBN FamCNtfRsiJQEEH5uShk5E+G2CzexzacdJJjtsrdjoul0OSrfxssxYJYyGtsfI+PQgQ7C0MhI qtAMQ78g3JELCuN32HCifNDij8iPm46eaMIABEOO3GavOAK3f/MYKxRGRGL91srDlv8MIJT+w bolQiDizjMGGVo5c1g26kJSzYMhHZVRtXqNnc6phHKacolxHTov1VJzdqZkXONDpbDoRY2EED N1RMt4yxVZUb1IqmiwGGSZM5WjO/YuH7qCjKhoRy/+D20oXwPRzNd7X0d4/PasehYrKZtyIdp ATTdEoUwiseG0SSe3XjBRH4TqqD8otkT3gMQxIqTmZa426VvxrxIC+LbICANWsk25P17u8V2s 5zhYX9iwKbIl2HW3nqi9ta357RL6YUkYcxcdCA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1292 Lines: 37 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