2020-09-21 13:13:21

by Qinglang Miao

[permalink] [raw]
Subject: [PATCH -next] virt: vbox: simplify the return expression of vbg_input_open()

Simplify the return expression.

Signed-off-by: Qinglang Miao <[email protected]>
---
drivers/virt/vboxguest/vboxguest_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c
index 6215a688e..73eb34849 100644
--- a/drivers/virt/vboxguest/vboxguest_linux.c
+++ b/drivers/virt/vboxguest/vboxguest_linux.c
@@ -202,13 +202,8 @@ static int vbg_input_open(struct input_dev *input)
{
struct vbg_dev *gdev = input_get_drvdata(input);
u32 feat = VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_NEW_PROTOCOL;
- int ret;

- ret = vbg_core_set_mouse_status(gdev, feat);
- if (ret)
- return ret;
-
- return 0;
+ return vbg_core_set_mouse_status(gdev, feat);
}

/**
--
2.23.0


2020-09-21 13:35:39

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH -next] virt: vbox: simplify the return expression of vbg_input_open()

Hi,

On 9/21/20 3:11 PM, Qinglang Miao wrote:
> Simplify the return expression.
>
> Signed-off-by: Qinglang Miao <[email protected]>

Thank you, patch looks good to me:

Reviewed-by: Hans de Goede <[email protected]>

Regards,

Hans



> ---
> drivers/virt/vboxguest/vboxguest_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c
> index 6215a688e..73eb34849 100644
> --- a/drivers/virt/vboxguest/vboxguest_linux.c
> +++ b/drivers/virt/vboxguest/vboxguest_linux.c
> @@ -202,13 +202,8 @@ static int vbg_input_open(struct input_dev *input)
> {
> struct vbg_dev *gdev = input_get_drvdata(input);
> u32 feat = VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_NEW_PROTOCOL;
> - int ret;
>
> - ret = vbg_core_set_mouse_status(gdev, feat);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return vbg_core_set_mouse_status(gdev, feat);
> }
>
> /**
>