Skip to content

Commit b884eb8

Browse files
committed
Input: sur40 - suppress false uninitialized variable warning
We will never use packet_id before initializing it as we start with "need_blobs == -1" and will set packet_id there. Also use le32_to_cpu when fetching header->packet_id. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 358f247 commit b884eb8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/input/touchscreen/sur40.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
251251
struct sur40_state *sur40 = polldev->private;
252252
struct input_dev *input = polldev->input;
253253
int result, bulk_read, need_blobs, packet_blobs, i;
254-
u32 packet_id;
254+
u32 uninitialized_var(packet_id);
255255

256256
struct sur40_header *header = &sur40->bulk_in_buffer->header;
257257
struct sur40_blob *inblob = &sur40->bulk_in_buffer->blobs[0];
@@ -286,7 +286,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
286286
if (need_blobs == -1) {
287287
need_blobs = le16_to_cpu(header->count);
288288
dev_dbg(sur40->dev, "need %d blobs\n", need_blobs);
289-
packet_id = header->packet_id;
289+
packet_id = le32_to_cpu(header->packet_id);
290290
}
291291

292292
/*

0 commit comments

Comments
 (0)