diff mbox series

HID: intel-ish-hid: Remove unnecessary assignment to variable rv

Message ID 20201110032049.187404-1-jingxiangfeng@huawei.com (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series HID: intel-ish-hid: Remove unnecessary assignment to variable rv | expand

Commit Message

Jing Xiangfeng Nov. 10, 2020, 3:20 a.m. UTC
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(-)

Comments

Jiri Kosina Nov. 25, 2020, 12:57 p.m. UTC | #1
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.
diff mbox series

Patch

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