* [PATCH] Input: Remove unneeded variable
@ 2022-04-19 6:42 cgel.zte
2022-04-20 20:56 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: cgel.zte @ 2022-04-19 6:42 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, linux-kernel, Changcheng Deng, Zeal Robot
From: Changcheng Deng <deng.changcheng@zte.com.cn>
Remove unneeded variable used to store return value.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
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 e5a668ce884d..1365c9dfb5f2 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1793,8 +1793,6 @@ EXPORT_SYMBOL(input_reset_device);
static int input_inhibit_device(struct input_dev *dev)
{
- int ret = 0;
-
mutex_lock(&dev->mutex);
if (dev->inhibited)
@@ -1816,7 +1814,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)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: Remove unneeded variable
2022-04-19 6:42 [PATCH] Input: Remove unneeded variable cgel.zte
@ 2022-04-20 20:56 ` Dmitry Torokhov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2022-04-20 20:56 UTC (permalink / raw)
To: cgel.zte; +Cc: linux-input, linux-kernel, Changcheng Deng, Zeal Robot
Ov> HID-over-I2C devices might reset on their own. Any device configuration
> applied before the reset might be brought back to defaults so we need to
> reconfigure to make sure the driver state is consistent.
>
> Add a reset callback to the hid driver structure.
> Issue it if the driver implements it and the device reset gets observed.
>
> Signed-off-by: Angela Czubak <acz@semihalf.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Input: Remove unneeded variable
@ 2021-02-25 9:18 angkery
0 siblings, 0 replies; 3+ messages in thread
From: angkery @ 2021-02-25 9:18 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, linux-kernel, Junlin Yang
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-20 20:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 6:42 [PATCH] Input: Remove unneeded variable cgel.zte
2022-04-20 20:56 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2021-02-25 9:18 angkery
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).