]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/line6/capture.c
Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc...
[mv-sheeva.git] / drivers / staging / line6 / capture.c
index 06a6db889fbd79f4d6686dd2fa2e095345e06170..1e3bb14063319620ea05b7b0a815521c0d09b2d9 100644 (file)
@@ -164,15 +164,19 @@ void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf, int fsize)
                               len * bytes_per_frame);
                        memcpy(runtime->dma_area, fbuf + len * bytes_per_frame,
                               (frames - len) * bytes_per_frame);
-               } else
-                       dev_err(line6pcm->line6->ifcdev, "driver bug: len = %d\n", len);        /* this is somewhat paranoid */
+               } else {
+                       /* this is somewhat paranoid */
+                       dev_err(line6pcm->line6->ifcdev,
+                               "driver bug: len = %d\n", len);
+               }
        } else {
                /* copy single chunk */
                memcpy(runtime->dma_area +
                       line6pcm->pos_in_done * bytes_per_frame, fbuf, fsize);
        }
 
-       if ((line6pcm->pos_in_done += frames) >= runtime->buffer_size)
+       line6pcm->pos_in_done += frames;
+       if (line6pcm->pos_in_done >= runtime->buffer_size)
                line6pcm->pos_in_done -= runtime->buffer_size;
 }
 
@@ -181,15 +185,16 @@ void line6_capture_check_period(struct snd_line6_pcm *line6pcm, int length)
        struct snd_pcm_substream *substream =
            get_substream(line6pcm, SNDRV_PCM_STREAM_CAPTURE);
 
-       if ((line6pcm->bytes_in += length) >= line6pcm->period_in) {
+       line6pcm->bytes_in += length;
+       if (line6pcm->bytes_in >= line6pcm->period_in) {
                line6pcm->bytes_in %= line6pcm->period_in;
                snd_pcm_period_elapsed(substream);
        }
 }
 
 /*
-  Callback for completed capture URB.
-*/
* Callback for completed capture URB.
+ */
 static void audio_in_callback(struct urb *urb)
 {
        int i, index, length = 0, shutdown = 0;