lkml.org 
[lkml]   [2013]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v2] drivers: input: touchscreen: sur40: remove stack variable 'packet_id' from sur40_poll()
The drivers process all blobs in one pass, so there is no need to
preserve value of packet_id between calls to sur40_poll().

And the original implementation may cause 'packet_id' uninitialized,
the related warning (with allmodconfig under hexagon):

drivers/input/touchscreen/sur40.c: In function 'sur40_poll':
drivers/input/touchscreen/sur40.c:297:6: warning: 'packet_id' may be used uninitialized in this function [-Wuninitialized]


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
drivers/input/touchscreen/sur40.c | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index cfd1b7e..2ca32cb 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -251,7 +251,6 @@ static void sur40_poll(struct input_polled_dev *polldev)
struct sur40_state *sur40 = polldev->private;
struct input_dev *input = polldev->input;
int result, bulk_read, need_blobs, packet_blobs, i;
- u32 packet_id;

struct sur40_header *header = &sur40->bulk_in_buffer->header;
struct sur40_blob *inblob = &sur40->bulk_in_buffer->blobs[0];
@@ -286,17 +285,8 @@ static void sur40_poll(struct input_polled_dev *polldev)
if (need_blobs == -1) {
need_blobs = le16_to_cpu(header->count);
dev_dbg(sur40->dev, "need %d blobs\n", need_blobs);
- packet_id = header->packet_id;
}

- /*
- * Sanity check. when video data is also being retrieved, the
- * packet ID will usually increase in the middle of a series
- * instead of at the end.
- */
- if (packet_id != header->packet_id)
- dev_warn(sur40->dev, "packet ID mismatch\n");
-
packet_blobs = result / sizeof(struct sur40_blob);
dev_dbg(sur40->dev, "received %d blobs\n", packet_blobs);

--
1.7.7.6

\
 
 \ /
  Last update: 2013-11-28 05:41    [W:0.038 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site