[Spice-devel] [PATCH spice-gtk v2 26/33] fixup! usb-redir: add implementation of emulated CD device
Frediano Ziglio
fziglio at redhat.com
Fri Aug 9 14:26:44 UTC 2019
Fix style indentation
---
src/usb-device-cd.c | 71 ++++++++++++++++++++++-----------------------
1 file changed, 35 insertions(+), 36 deletions(-)
diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c
index 3c57185f..b03d6838 100644
--- a/src/usb-device-cd.c
+++ b/src/usb-device-cd.c
@@ -461,27 +461,26 @@ static gboolean usb_cd_get_descriptor(UsbCd *d, uint8_t type, uint8_t index,
void *p = NULL;
uint16_t len = 0;
- switch (type)
- {
- case LIBUSB_DT_DEVICE:
- p = &desc;
- len = sizeof(desc);
- break;
- case LIBUSB_DT_CONFIG:
- p = cfg;
- len = sizeof(cfg);
- break;
- case LIBUSB_DT_STRING:
- if (index == 0) {
- p = s0; len = sizeof(s0);
- } else if (index == 1) {
- p = s1; len = sizeof(s1);
- } else if (index == 2) {
- p = s2; len = sizeof(s2);
- } else if (index == 3) {
- p = d->serial; len = sizeof(d->serial);
- }
- break;
+ switch (type) {
+ case LIBUSB_DT_DEVICE:
+ p = &desc;
+ len = sizeof(desc);
+ break;
+ case LIBUSB_DT_CONFIG:
+ p = cfg;
+ len = sizeof(cfg);
+ break;
+ case LIBUSB_DT_STRING:
+ if (index == 0) {
+ p = s0; len = sizeof(s0);
+ } else if (index == 1) {
+ p = s1; len = sizeof(s1);
+ } else if (index == 2) {
+ p = s2; len = sizeof(s2);
+ } else if (index == 3) {
+ p = d->serial; len = sizeof(d->serial);
+ }
+ break;
}
if (p) {
@@ -525,21 +524,21 @@ static void usb_cd_control_request(UsbCd *device,
if (reqtype == (LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE)) {
switch (h->request) {
- case 0xFF:
- // mass-storage class request 'reset'
- usb_cd_reset(device);
- h->length = 0;
- h->status = usb_redir_success;
- break;
- case 0xFE:
- // mass-storage class request 'get max lun'
- // returning one byte
- if (h->length) {
- h->length = 1;
- h->status = usb_redir_success;;
- *buffer = &device->max_lun_index;
- }
- break;
+ case 0xFF:
+ // mass-storage class request 'reset'
+ usb_cd_reset(device);
+ h->length = 0;
+ h->status = usb_redir_success;
+ break;
+ case 0xFE:
+ // mass-storage class request 'get max lun'
+ // returning one byte
+ if (h->length) {
+ h->length = 1;
+ h->status = usb_redir_success;;
+ *buffer = &device->max_lun_index;
+ }
+ break;
}
}
}
--
2.20.1
More information about the Spice-devel
mailing list