summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorLuis Ortega <luiorpe1@upv.es>2014-01-27 12:28:33 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-01-27 22:35:17 -0800
commitd333b6062f1414622d1fe37314fa2ec9e3df402d (patch)
tree9a34bd475dcf6b414dcb182cc9d2bf14ddc391f3 /drivers/input/touchscreen
parent5aee41a60c4d53f65918c1ec0ab94c245f2c08af (diff)
Input: zforce - reduce stack memory allocated to frames
A frame is a u8 array with the following structure: [PAYLOAD_HEADER, PAYLOAD_LENGTH, ...PAYLOAD_BODY...] PAYLOAD_BODY can be at most 255 bytes long, as it's size is represented by PAYLOAD_LENGTH. Therefore we can reduce the stack memory allocated to payload_buffer[] roughly by half, from 512 to 257 bytes. Signed-off-by: Luis Ortega <luiorpe1@upv.es> Acked-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Heiko Stuebner <heiko@sntech.de> - bq Cervantes (imx6sl) Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/zforce_ts.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 3ed024985a5..307f582eeab 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -33,6 +33,7 @@
#define WAIT_TIMEOUT msecs_to_jiffies(1000)
#define FRAME_START 0xee
+#define FRAME_MAXSIZE 257
/* Offsets of the different parts of the payload the controller sends */
#define PAYLOAD_HEADER 0
@@ -464,7 +465,7 @@ static irqreturn_t zforce_interrupt(int irq, void *dev_id)
struct i2c_client *client = ts->client;
const struct zforce_ts_platdata *pdata = dev_get_platdata(&client->dev);
int ret;
- u8 payload_buffer[512];
+ u8 payload_buffer[FRAME_MAXSIZE];
u8 *payload;
/*