[Spice-commits] src/usb-device-manager.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Dec 18 13:50:32 UTC 2019
src/usb-device-manager.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
New commits:
commit e2898dfd9ea01f97ee93e167fee1972cd1c384ef
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Dec 6 14:12:56 2019 +0000
usb-device-manager: Remove disconnect_cb_data
"device" field is just written, never read.
"manager" field can be retrieved using g_task_get_source_object.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Signed-off-by: Snir Sheriber <ssheribe at redhat.com>
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 43cd387..c6a6b9c 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -1257,12 +1257,6 @@ void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *manager,
disconnect_device_sync(manager, device);
}
-typedef struct _disconnect_cb_data
-{
- SpiceUsbDeviceManager *manager;
- SpiceUsbDevice *device;
-} disconnect_cb_data;
-
#ifdef USE_USBREDIR
static
void _disconnect_device_async_cb(GObject *gobject,
@@ -1272,8 +1266,7 @@ void _disconnect_device_async_cb(GObject *gobject,
SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(gobject);
GTask *task = user_data;
GError *err = NULL;
- disconnect_cb_data *data = g_task_get_task_data(task);
- SpiceUsbDeviceManager *manager = SPICE_USB_DEVICE_MANAGER(data->manager);
+ SpiceUsbDeviceManager *manager = SPICE_USB_DEVICE_MANAGER(g_task_get_source_object(task));
_set_redirecting(manager, FALSE);
@@ -1323,10 +1316,6 @@ void spice_usb_device_manager_disconnect_device_async(SpiceUsbDeviceManager *man
channel = spice_usb_device_manager_get_channel_for_dev(manager, device);
nested = g_task_new(G_OBJECT(manager), cancellable, callback, user_data);
- disconnect_cb_data *data = g_new(disconnect_cb_data, 1);
- data->manager = manager;
- data->device = device;
- g_task_set_task_data(nested, data, g_free);
spice_usbredir_channel_disconnect_device_async(channel, cancellable,
_disconnect_device_async_cb,
More information about the Spice-commits
mailing list