提交 78fa2c4d 编写于 作者: L Luca Tettamanti 提交者: Takashi Iwai

ALSA: core: remove unused variables.

Drop a few variables that are never read.
Signed-off-by: NLuca Tettamanti <kronos.it@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 f2b3614c
...@@ -704,13 +704,12 @@ static int snd_ctl_elem_list(struct snd_card *card, ...@@ -704,13 +704,12 @@ static int snd_ctl_elem_list(struct snd_card *card,
struct snd_ctl_elem_list list; struct snd_ctl_elem_list list;
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
struct snd_ctl_elem_id *dst, *id; struct snd_ctl_elem_id *dst, *id;
unsigned int offset, space, first, jidx; unsigned int offset, space, jidx;
if (copy_from_user(&list, _list, sizeof(list))) if (copy_from_user(&list, _list, sizeof(list)))
return -EFAULT; return -EFAULT;
offset = list.offset; offset = list.offset;
space = list.space; space = list.space;
first = 0;
/* try limit maximum space */ /* try limit maximum space */
if (space > 16384) if (space > 16384)
return -ENOMEM; return -ENOMEM;
......
...@@ -342,7 +342,6 @@ static const struct file_operations snd_shutdown_f_ops = ...@@ -342,7 +342,6 @@ static const struct file_operations snd_shutdown_f_ops =
int snd_card_disconnect(struct snd_card *card) int snd_card_disconnect(struct snd_card *card)
{ {
struct snd_monitor_file *mfile; struct snd_monitor_file *mfile;
struct file *file;
int err; int err;
if (!card) if (!card)
...@@ -366,8 +365,6 @@ int snd_card_disconnect(struct snd_card *card) ...@@ -366,8 +365,6 @@ int snd_card_disconnect(struct snd_card *card)
spin_lock(&card->files_lock); spin_lock(&card->files_lock);
list_for_each_entry(mfile, &card->files_list, list) { list_for_each_entry(mfile, &card->files_list, list) {
file = mfile->file;
/* it's critical part, use endless loop */ /* it's critical part, use endless loop */
/* we have no room to fail */ /* we have no room to fail */
mfile->disconnected_f_op = mfile->file->f_op; mfile->disconnected_f_op = mfile->file->f_op;
......
...@@ -90,11 +90,8 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin, ...@@ -90,11 +90,8 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
struct snd_pcm_plugin_channel *dst_channels, struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames) snd_pcm_uframes_t frames)
{ {
struct linear_priv *data;
if (snd_BUG_ON(!plugin || !src_channels || !dst_channels)) if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
return -ENXIO; return -ENXIO;
data = (struct linear_priv *)plugin->extra_data;
if (frames == 0) if (frames == 0)
return 0; return 0;
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
......
...@@ -1527,13 +1527,11 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream, ...@@ -1527,13 +1527,11 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
static int snd_pcm_drop(struct snd_pcm_substream *substream) static int snd_pcm_drop(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime; struct snd_pcm_runtime *runtime;
struct snd_card *card;
int result = 0; int result = 0;
if (PCM_RUNTIME_CHECK(substream)) if (PCM_RUNTIME_CHECK(substream))
return -ENXIO; return -ENXIO;
runtime = substream->runtime; runtime = substream->runtime;
card = substream->pcm->card;
if (runtime->status->state == SNDRV_PCM_STATE_OPEN || if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED || runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED ||
...@@ -2065,7 +2063,6 @@ static int snd_pcm_open_file(struct file *file, ...@@ -2065,7 +2063,6 @@ static int snd_pcm_open_file(struct file *file,
{ {
struct snd_pcm_file *pcm_file; struct snd_pcm_file *pcm_file;
struct snd_pcm_substream *substream; struct snd_pcm_substream *substream;
struct snd_pcm_str *str;
int err; int err;
if (rpcm_file) if (rpcm_file)
...@@ -2082,7 +2079,6 @@ static int snd_pcm_open_file(struct file *file, ...@@ -2082,7 +2079,6 @@ static int snd_pcm_open_file(struct file *file,
} }
pcm_file->substream = substream; pcm_file->substream = substream;
if (substream->ref_count == 1) { if (substream->ref_count == 1) {
str = substream->pstr;
substream->file = pcm_file; substream->file = pcm_file;
substream->pcm_release = pcm_release_private; substream->pcm_release = pcm_release_private;
} }
...@@ -3024,11 +3020,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_status = ...@@ -3024,11 +3020,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_status =
static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file,
struct vm_area_struct *area) struct vm_area_struct *area)
{ {
struct snd_pcm_runtime *runtime;
long size; long size;
if (!(area->vm_flags & VM_READ)) if (!(area->vm_flags & VM_READ))
return -EINVAL; return -EINVAL;
runtime = substream->runtime;
size = area->vm_end - area->vm_start; size = area->vm_end - area->vm_start;
if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status))) if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)))
return -EINVAL; return -EINVAL;
...@@ -3063,11 +3057,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_control = ...@@ -3063,11 +3057,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_control =
static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file,
struct vm_area_struct *area) struct vm_area_struct *area)
{ {
struct snd_pcm_runtime *runtime;
long size; long size;
if (!(area->vm_flags & VM_READ)) if (!(area->vm_flags & VM_READ))
return -EINVAL; return -EINVAL;
runtime = substream->runtime;
size = area->vm_end - area->vm_start; size = area->vm_end - area->vm_start;
if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))) if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)))
return -EINVAL; return -EINVAL;
......
...@@ -467,13 +467,11 @@ int snd_seq_queue_timer_open(int queueid) ...@@ -467,13 +467,11 @@ int snd_seq_queue_timer_open(int queueid)
int snd_seq_queue_timer_close(int queueid) int snd_seq_queue_timer_close(int queueid)
{ {
struct snd_seq_queue *queue; struct snd_seq_queue *queue;
struct snd_seq_timer *tmr;
int result = 0; int result = 0;
queue = queueptr(queueid); queue = queueptr(queueid);
if (queue == NULL) if (queue == NULL)
return -EINVAL; return -EINVAL;
tmr = queue->timer;
snd_seq_timer_close(queue); snd_seq_timer_close(queue);
queuefree(queue); queuefree(queue);
return result; return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册