[spice-gtk,v2,26/33] fixup! usb-redir: add implementation of emulated CD device

Submitted by Frediano Ziglio on Aug. 9, 2019, 2:26 p.m.

Details

Message ID 20190809142651.2967-27-fziglio@redhat.com
State Superseded
Headers show
Series "CD emulation follow ups" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Aug. 9, 2019, 2:26 p.m.
Fix style indentation
---
 src/usb-device-cd.c | 71 ++++++++++++++++++++++-----------------------
 1 file changed, 35 insertions(+), 36 deletions(-)

Patch hide | download patch | download mbox

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;
         }
     }
 }