linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: angkery <angkery@163.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Junlin Yang <yangjunlin@yulong.com>
Subject: [PATCH] Input: Remove unneeded variable
Date: Thu, 25 Feb 2021 17:18:30 +0800	[thread overview]
Message-ID: <20210225091830.545-1-angkery@163.com> (raw)

From: Junlin Yang <yangjunlin@yulong.com>

The variable "ret" is initialized to zero and then returned.
So remove the ret variable and return zero.

Generated by:scripts/coccinelle/misc/returnvar.cocci

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
---
 drivers/input/input.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index ccaeb24..8cdc3fe 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1746,8 +1746,6 @@ void input_reset_device(struct input_dev *dev)
 
 static int input_inhibit_device(struct input_dev *dev)
 {
-	int ret = 0;
-
 	mutex_lock(&dev->mutex);
 
 	if (dev->inhibited)
@@ -1769,7 +1767,7 @@ static int input_inhibit_device(struct input_dev *dev)
 
 out:
 	mutex_unlock(&dev->mutex);
-	return ret;
+	return 0;
 }
 
 static int input_uninhibit_device(struct input_dev *dev)
-- 
1.9.1


             reply	other threads:[~2021-02-25 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  9:18 angkery [this message]
2022-04-19  6:42 [PATCH] Input: Remove unneeded variable cgel.zte
2022-04-20 20:56 ` Dmitry Torokhov

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=20210225091830.545-1-angkery@163.com \
    --to=angkery@163.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangjunlin@yulong.com \
    /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).