]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
Consistency and whitespace fixes for switch statements.
[libsigrok.git] / src / hardware / fx2lafw / api.c
index 1fb2235f1e57bedf1ed61c216eaf0ce6361a94ae..6fd89795624f3a79a1f1e95e74c810cdebf2cb8a 100644 (file)
@@ -518,30 +518,30 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        ret = SR_OK;
 
        switch (key) {
-               case SR_CONF_SAMPLERATE:
-                       arg = g_variant_get_uint64(data);
-                       for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
-                               if (samplerates[i] == arg) {
-                                       devc->cur_samplerate = arg;
-                                       break;
-                               }
+       case SR_CONF_SAMPLERATE:
+               arg = g_variant_get_uint64(data);
+               for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
+                       if (samplerates[i] == arg) {
+                               devc->cur_samplerate = arg;
+                               break;
                        }
-                       if (i == ARRAY_SIZE(samplerates))
-                               ret = SR_ERR_ARG;
-                       break;
-               case SR_CONF_LIMIT_SAMPLES:
-                       devc->limit_samples = g_variant_get_uint64(data);
-                       break;
-               case SR_CONF_CAPTURE_RATIO:
-                       devc->capture_ratio = g_variant_get_uint64(data);
-                       if (devc->capture_ratio > 100) {
-                               devc->capture_ratio = 0;
-                               ret = SR_ERR;
-                       } else
-                               ret = SR_OK;
-                       break;
-               default:
-                       ret = SR_ERR_NA;
+               }
+               if (i == ARRAY_SIZE(samplerates))
+                       ret = SR_ERR_ARG;
+               break;
+       case SR_CONF_LIMIT_SAMPLES:
+               devc->limit_samples = g_variant_get_uint64(data);
+               break;
+       case SR_CONF_CAPTURE_RATIO:
+               devc->capture_ratio = g_variant_get_uint64(data);
+               if (devc->capture_ratio > 100) {
+                       devc->capture_ratio = 0;
+                       ret = SR_ERR;
+               } else
+                       ret = SR_OK;
+               break;
+       default:
+               ret = SR_ERR_NA;
        }
 
        return ret;
@@ -598,9 +598,8 @@ static int receive_data(int fd, int revents, void *cb_data)
 
        (void)fd;
        (void)revents;
-       (void)cb_data;
 
-       drvc = (struct drv_context *) cb_data;
+       drvc = (struct drv_context *)cb_data;
 
        tv.tv_sec = tv.tv_usec = 0;
        libusb_handle_events_timeout(drvc->sr_ctx->libusb_ctx, &tv);