From: Arnd Bergmann <arnd@arndb.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Marcus Wolf <linux@Wolf-Entwicklungen.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
Joseph Wright <rjosephwright@gmail.com>,
"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
Derek Robson <robsonde@gmail.com>,
Colin Ian King <colin.king@canonical.com>,
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 [thread overview]
Message-ID: <20170731085812.361318-1-arnd@arndb.de> (raw)
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 <arnd@arndb.de>
---
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
next reply other threads:[~2017-07-31 8:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 8:57 Arnd Bergmann [this message]
2017-08-02 8:20 ` Wolf Entwicklungen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170731085812.361318-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=colin.king@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@Wolf-Entwicklungen.de \
--cc=rjosephwright@gmail.com \
--cc=robsonde@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®