Staging: line6: fix checkpatch errors in capture.c

2 errors left, but they are minor.
Lots of warnings also fixed up.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-02-27 22:39:22 -08:00
parent a49e483835
commit 6efc5667ef

View file

@ -71,9 +71,11 @@ static int submit_audio_in_all_urbs(struct snd_pcm_substream *substream)
{
int ret, i;
for(i = 0; i < LINE6_ISO_BUFFERS; ++i)
if((ret = submit_audio_in_urb(substream)) < 0)
for (i = 0; i < LINE6_ISO_BUFFERS; ++i) {
ret = submit_audio_in_urb(substream);
if (ret < 0)
return ret;
}
return 0;
}
@ -96,7 +98,8 @@ static void unlink_audio_in_urbs(struct snd_line6_pcm *line6pcm)
}
/*
Wait until unlinking of all currently active capture URBs has been finished.
Wait until unlinking of all currently active capture URBs has been
finished.
*/
static void wait_clear_audio_in_urbs(struct snd_line6_pcm *line6pcm)
{
@ -187,11 +190,9 @@ static void audio_in_callback(struct urb *urb)
if (len > 0) {
memcpy(runtime->dma_area + line6pcm->pos_in_done * bytes_per_frame, fbuf, len * bytes_per_frame);
memcpy(runtime->dma_area, fbuf + len * bytes_per_frame, (frames - len) * bytes_per_frame);
}
else
} else
dev_err(s2m(substream), "driver bug: len = %d\n", len); /* this is somewhat paranoid */
}
else {
} else {
/* copy single chunk */
memcpy(runtime->dma_area + line6pcm->pos_in_done * bytes_per_frame, fbuf, fsize * bytes_per_frame);
}
@ -225,8 +226,10 @@ static int snd_line6_capture_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
if((err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
(&line6pcm->properties->snd_line6_rates))) < 0)
err = snd_pcm_hw_constraint_ratdens(runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
(&line6pcm->properties->snd_line6_rates));
if (err < 0)
return err;
runtime->hw = line6pcm->properties->snd_line6_capture_hw;
@ -240,7 +243,8 @@ static int snd_line6_capture_close(struct snd_pcm_substream *substream)
}
/* hw_params capture callback */
static int snd_line6_capture_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params)
static int snd_line6_capture_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
int ret;
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
@ -257,7 +261,9 @@ static int snd_line6_capture_hw_params(struct snd_pcm_substream *substream, stru
}
/* -- [FD] end */
if((ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
ret = snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
if (ret < 0)
return ret;
line6pcm->period_in = params_period_bytes(hw_params);
@ -277,10 +283,8 @@ static int snd_line6_capture_hw_free(struct snd_pcm_substream *substream)
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
unlink_wait_clear_audio_in_urbs(line6pcm);
if(line6pcm->buffer_in) {
kfree(line6pcm->buffer_in);
line6pcm->buffer_in = NULL;
}
return snd_pcm_lib_free_pages(substream);
}