From: Chen Gang <gang.chen.5i5j@gmail.com>
To: dmitry.torokhov@gmail.com, floe@butterbrot.org,
rydberg@euromail.se, David Herrmann <dh.herrmann@gmail.com>
Cc: rkuo <rkuo@codeaurora.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-input@vger.kernel.org
Subject: [PATCH] drivers: input: touchscreen: sur40: use static variable instead of stack varialbe for 'packet_id'
Date: Wed, 27 Nov 2013 10:15:33 +0800 [thread overview]
Message-ID: <529555C5.7030404@gmail.com> (raw)
In-Reply-To: <20131125011908.GA18921@codeaurora.org>
'packet_id' is used for checking sequence whether in order, it need be
static variable independent from sur40_poll().
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 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index cfd1b7e..5dfd01a 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -251,7 +251,7 @@ 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;
+ static u32 packet_id;
struct sur40_header *header = &sur40->bulk_in_buffer->header;
struct sur40_blob *inblob = &sur40->bulk_in_buffer->blobs[0];
--
1.7.7.6
next parent reply other threads:[~2013-11-27 2:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <528AD6B3.1060507@gmail.com>
[not found] ` <20131125011908.GA18921@codeaurora.org>
2013-11-27 2:15 ` Chen Gang [this message]
2013-11-28 4:07 ` [PATCH] drivers: input: touchscreen: sur40: use static variable instead of stack varialbe for 'packet_id' Dmitry Torokhov
2013-11-28 4:24 ` Chen Gang
2013-11-28 4:34 ` [PATCH v2] drivers: input: touchscreen: sur40: remove stack variable 'packet_id' from sur40_poll() Chen Gang
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=529555C5.7030404@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=dh.herrmann@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=floe@butterbrot.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkuo@codeaurora.org \
--cc=rydberg@euromail.se \
/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;
as well as URLs for NNTP newsgroup(s).