From: Joe Perches <joe@perches.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: gtco: remove unnecessary variable assignments
Date: Wed, 14 Jun 2017 22:00:48 -0700 [thread overview]
Message-ID: <1497502848.14396.2.camel@perches.com> (raw)
In-Reply-To: <20170615015029.GA5601@embeddedgus>
On Wed, 2017-06-14 at 20:50 -0500, Gustavo A. R. Silva wrote:
> Remove unnecessary variable assignments.
> Variable _val_ is overwritten before the value stored in it can be used.
>
> Addresses-Coverity-ID: 1397695
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> drivers/input/tablet/gtco.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
> index b796e89..d9de13c 100644
> --- a/drivers/input/tablet/gtco.c
> +++ b/drivers/input/tablet/gtco.c
> @@ -652,8 +652,6 @@ static void gtco_urb_callback(struct urb *urbinfo)
> switch (device->buffer[0]) {
> case 5:
> /* Pressure is 9 bits */
> - val = ((u16)(device->buffer[8]) << 1);
> - val |= (u16)(device->buffer[7] >> 7);
> input_report_abs(inputdev, ABS_PRESSURE,
> device->buffer[8]);
Perhaps more likely to be
input_report_abs(inputdev, ABS_PRESSURE, val);
next prev parent reply other threads:[~2017-06-15 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 1:50 [PATCH] USB: gtco: remove unnecessary variable assignments Gustavo A. R. Silva
2017-06-15 5:00 ` Joe Perches [this message]
2017-06-15 19:25 ` ulrik.debie-os
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=1497502848.14396.2.camel@perches.com \
--to=joe@perches.com \
--cc=dmitry.torokhov@gmail.com \
--cc=garsilva@embeddedor.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).