From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Colin King <colin.king@canonical.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: cyapa: remove redundant assignment to 'pwr_cmd'
Date: Thu, 18 Jan 2018 11:22:25 -0800 [thread overview]
Message-ID: <20180118192225.n6scc424psan7iwn@dtor-ws> (raw)
In-Reply-To: <20180117104519.19422-1-colin.king@canonical.com>
On Wed, Jan 17, 2018 at 10:45:19AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable pwr_cmd is being assigned to cyapa->suspend_power_mode
> twice, once during the declaration and once after taking an
> interruptible mutex lock. Remove the redundant first assignment
> since the value is never read and it is outside the mutex lock.
>
> Cleans up clang warning:
> drivers/input/mouse/cyapa.c:743:5: warning: Value stored to 'pwr_cmd'
> during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thank you.
> ---
> drivers/input/mouse/cyapa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
> index fd8865c65caf..dfd3873513e4 100644
> --- a/drivers/input/mouse/cyapa.c
> +++ b/drivers/input/mouse/cyapa.c
> @@ -740,7 +740,7 @@ static ssize_t cyapa_show_suspend_scanrate(struct device *dev,
> char *buf)
> {
> struct cyapa *cyapa = dev_get_drvdata(dev);
> - u8 pwr_cmd = cyapa->suspend_power_mode;
> + u8 pwr_cmd;
> u16 sleep_time;
> int len;
> int error;
> --
> 2.15.1
>
--
Dmitry
prev parent reply other threads:[~2018-01-18 19:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 10:45 [PATCH] input: cyapa: remove redundant assignment to 'pwr_cmd' Colin King
2018-01-18 19:22 ` Dmitry Torokhov [this message]
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=20180118192225.n6scc424psan7iwn@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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