linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: intel-ish-hid: Remove unnecessary assignment to variable rv
@ 2020-11-10  3:20 Jing Xiangfeng
  2020-11-25 12:57 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Jing Xiangfeng @ 2020-11-10  3:20 UTC (permalink / raw)
  To: srinivas.pandruvada, jikos, benjamin.tissoires
  Cc: linux-input, linux-kernel, jingxiangfeng

This assignment to rv is unused in an error path. So remove it.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 drivers/hid/intel-ish-hid/ishtp-hid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
index b8aae69ad15d..393bed0abee9 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
@@ -211,10 +211,8 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
 	struct ishtp_hid_data *hid_data;
 
 	hid = hid_allocate_device();
-	if (IS_ERR(hid)) {
-		rv = PTR_ERR(hid);
-		return	-ENOMEM;
-	}
+	if (IS_ERR(hid))
+		return PTR_ERR(hid);
 
 	hid_data = kzalloc(sizeof(*hid_data), GFP_KERNEL);
 	if (!hid_data) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: Remove unnecessary assignment to variable rv
  2020-11-10  3:20 [PATCH] HID: intel-ish-hid: Remove unnecessary assignment to variable rv Jing Xiangfeng
@ 2020-11-25 12:57 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2020-11-25 12:57 UTC (permalink / raw)
  To: Jing Xiangfeng
  Cc: srinivas.pandruvada, benjamin.tissoires, linux-input, linux-kernel

On Tue, 10 Nov 2020, Jing Xiangfeng wrote:

> This assignment to rv is unused in an error path. So remove it.
> 
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
> ---
>  drivers/hid/intel-ish-hid/ishtp-hid.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
> index b8aae69ad15d..393bed0abee9 100644
> --- a/drivers/hid/intel-ish-hid/ishtp-hid.c
> +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
> @@ -211,10 +211,8 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
>  	struct ishtp_hid_data *hid_data;
>  
>  	hid = hid_allocate_device();
> -	if (IS_ERR(hid)) {
> -		rv = PTR_ERR(hid);
> -		return	-ENOMEM;
> -	}
> +	if (IS_ERR(hid))
> +		return PTR_ERR(hid);
>  

Applied, thank you.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-25 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10  3:20 [PATCH] HID: intel-ish-hid: Remove unnecessary assignment to variable rv Jing Xiangfeng
2020-11-25 12:57 ` Jiri Kosina

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).