[Spice-devel] [PATCH spice-gtk 02/14] win-usb: introduce a spice_win_usb_driver_op_finish
Jonathon Jongsma
jjongsma at redhat.com
Wed Apr 23 13:33:16 PDT 2014
Looks fine, ACK. But can you please use the git commit message to explain *why* you're making the change. Is it necessary for some future refactoring? Is it just cleanup? etc. I suppose it'll become more obvious as I review later patches, but it saves a little headscratching if the justification is explicitly stated.
----- Original Message -----
> From: "Marc-André Lureau" <marcandre.lureau at gmail.com>
> To: spice-devel at freedesktop.org
> Sent: Wednesday, April 23, 2014 1:09:07 PM
> Subject: [Spice-devel] [PATCH spice-gtk 02/14] win-usb: introduce a spice_win_usb_driver_op_finish
>
> ---
> gtk/win-usb-driver-install.c | 34 +++++++++++++++++++---------------
> 1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/gtk/win-usb-driver-install.c b/gtk/win-usb-driver-install.c
> index 928b38f..2e2a48b 100644
> --- a/gtk/win-usb-driver-install.c
> +++ b/gtk/win-usb-driver-install.c
> @@ -325,7 +325,25 @@ void spice_win_usb_driver_op(SpiceWinUsbDriver *self,
> g_clear_object(&result);
> }
>
> +/**
> + * Returns: currently returns 0 (failure) and 1 (success)
> + * possibly later we'll add error-codes
> + */
> +static gint
> +spice_win_usb_driver_op_finish(SpiceWinUsbDriver *self,
> + GAsyncResult *res, GError **err)
> +{
> + GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT(res);
>
> + g_return_val_if_fail(SPICE_IS_WIN_USB_DRIVER(self), 0);
> + g_return_val_if_fail(g_simple_async_result_is_valid(res, G_OBJECT(self),
> +
> spice_win_usb_driver_op),
> + FALSE);
> + if (g_simple_async_result_propagate_error(result, err))
> + return 0;
> +
> + return self->priv->reply.status;
> +}
>
> /**
> * spice_win_usb_driver_install:
> @@ -362,25 +380,11 @@ void spice_win_usb_driver_uninstall(SpiceWinUsbDriver
> *self,
> callback, user_data);
> }
>
> -
> -/**
> - * Returns: currently returns 0 (failure) and 1 (success)
> - * possibly later we'll add error-codes
> - */
> G_GNUC_INTERNAL
> gint spice_win_usb_driver_install_finish(SpiceWinUsbDriver *self,
> GAsyncResult *res, GError **err)
> {
> - GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT(res);
> -
> - g_return_val_if_fail(SPICE_IS_WIN_USB_DRIVER(self), 0);
> - g_return_val_if_fail(g_simple_async_result_is_valid(res, G_OBJECT(self),
> -
> spice_win_usb_driver_op),
> - FALSE);
> - if (g_simple_async_result_propagate_error(result, err))
> - return 0;
> -
> - return self->priv->reply.status;
> + return spice_win_usb_driver_op_finish(self, res, err);
> }
>
> G_GNUC_INTERNAL
> --
> 1.8.5.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
More information about the Spice-devel
mailing list