2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 21:24:00 +08:00

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; int ret, i;
for(i = 0; i < LINE6_ISO_BUFFERS; ++i) for (i = 0; i < LINE6_ISO_BUFFERS; ++i) {
if((ret = submit_audio_in_urb(substream)) < 0) ret = submit_audio_in_urb(substream);
if (ret < 0)
return ret; return ret;
}
return 0; 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) 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) { if (len > 0) {
memcpy(runtime->dma_area + line6pcm->pos_in_done * bytes_per_frame, fbuf, len * bytes_per_frame); 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); 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 */ dev_err(s2m(substream), "driver bug: len = %d\n", len); /* this is somewhat paranoid */
} } else {
else {
/* copy single chunk */ /* copy single chunk */
memcpy(runtime->dma_area + line6pcm->pos_in_done * bytes_per_frame, fbuf, fsize * bytes_per_frame); 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_pcm_runtime *runtime = substream->runtime;
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
if((err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, err = snd_pcm_hw_constraint_ratdens(runtime, 0,
(&line6pcm->properties->snd_line6_rates))) < 0) SNDRV_PCM_HW_PARAM_RATE,
(&line6pcm->properties->snd_line6_rates));
if (err < 0)
return err; return err;
runtime->hw = line6pcm->properties->snd_line6_capture_hw; 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 */ /* 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; int ret;
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); 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 */ /* -- [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; return ret;
line6pcm->period_in = params_period_bytes(hw_params); 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); struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
unlink_wait_clear_audio_in_urbs(line6pcm); unlink_wait_clear_audio_in_urbs(line6pcm);
if(line6pcm->buffer_in) {
kfree(line6pcm->buffer_in); kfree(line6pcm->buffer_in);
line6pcm->buffer_in = NULL; line6pcm->buffer_in = NULL;
}
return snd_pcm_lib_free_pages(substream); return snd_pcm_lib_free_pages(substream);
} }