]> code.delx.au - pulseaudio/commitdiff
bluetooth: Fix early return styling and add missing return value
authorColin Guthrie <colin@mageia.org>
Sun, 15 May 2011 14:05:44 +0000 (15:05 +0100)
committerColin Guthrie <colin@mageia.org>
Sun, 15 May 2011 14:05:55 +0000 (15:05 +0100)
Thanks to Tanu Kaskinen for pointing out the missing return.

src/modules/bluetooth/module-bluetooth-device.c

index 086fce9c6908529cc81d8e25c220ee7aaccc86f1..1ff752a96025cc8f442a3f5a85c7c0e0b966b947 100644 (file)
@@ -1936,10 +1936,11 @@ static int sco_over_pcm_state_update(struct userdata *u, pa_bool_t changed) {
 
         if (u->transport)
             return bt_transport_acquire(u, TRUE);
-        else
-            return start_stream_fd(u);
 
-    } else if (changed) {
+        return start_stream_fd(u);
+    }
+
+    if (changed) {
         if (u->service_fd < 0 && u->stream_fd < 0)
             return 0;
 
@@ -1954,9 +1955,9 @@ static int sco_over_pcm_state_update(struct userdata *u, pa_bool_t changed) {
             pa_close(u->service_fd);
             u->service_fd = -1;
         }
-
-        return 0;
     }
+
+    return 0;
 }
 
 static pa_hook_result_t sink_state_changed_cb(pa_core *c, pa_sink *s, struct userdata *u) {