Skip to content

Commit 78fa2c4

Browse files
tettamantitiwai
authored andcommitted
ALSA: core: remove unused variables.
Drop a few variables that are never read. Signed-off-by: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent f2b3614 commit 78fa2c4

5 files changed

Lines changed: 1 addition & 18 deletions

File tree

‎sound/core/control.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,13 +704,12 @@ static int snd_ctl_elem_list(struct snd_card *card,
704704
struct snd_ctl_elem_list list;
705705
struct snd_kcontrol *kctl;
706706
struct snd_ctl_elem_id *dst, *id;
707-
unsigned int offset, space, first, jidx;
707+
unsigned int offset, space, jidx;
708708

709709
if (copy_from_user(&list, _list, sizeof(list)))
710710
return -EFAULT;
711711
offset = list.offset;
712712
space = list.space;
713-
first = 0;
714713
/* try limit maximum space */
715714
if (space > 16384)
716715
return -ENOMEM;

‎sound/core/init.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ static const struct file_operations snd_shutdown_f_ops =
342342
int snd_card_disconnect(struct snd_card *card)
343343
{
344344
struct snd_monitor_file *mfile;
345-
struct file *file;
346345
int err;
347346

348347
if (!card)
@@ -366,8 +365,6 @@ int snd_card_disconnect(struct snd_card *card)
366365

367366
spin_lock(&card->files_lock);
368367
list_for_each_entry(mfile, &card->files_list, list) {
369-
file = mfile->file;
370-
371368
/* it's critical part, use endless loop */
372369
/* we have no room to fail */
373370
mfile->disconnected_f_op = mfile->file->f_op;

‎sound/core/oss/linear.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
9090
struct snd_pcm_plugin_channel *dst_channels,
9191
snd_pcm_uframes_t frames)
9292
{
93-
struct linear_priv *data;
94-
9593
if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
9694
return -ENXIO;
97-
data = (struct linear_priv *)plugin->extra_data;
9895
if (frames == 0)
9996
return 0;
10097
#ifdef CONFIG_SND_DEBUG

‎sound/core/pcm_native.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,13 +1527,11 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
15271527
static int snd_pcm_drop(struct snd_pcm_substream *substream)
15281528
{
15291529
struct snd_pcm_runtime *runtime;
1530-
struct snd_card *card;
15311530
int result = 0;
15321531

15331532
if (PCM_RUNTIME_CHECK(substream))
15341533
return -ENXIO;
15351534
runtime = substream->runtime;
1536-
card = substream->pcm->card;
15371535

15381536
if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
15391537
runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED ||
@@ -2065,7 +2063,6 @@ static int snd_pcm_open_file(struct file *file,
20652063
{
20662064
struct snd_pcm_file *pcm_file;
20672065
struct snd_pcm_substream *substream;
2068-
struct snd_pcm_str *str;
20692066
int err;
20702067

20712068
if (rpcm_file)
@@ -2082,7 +2079,6 @@ static int snd_pcm_open_file(struct file *file,
20822079
}
20832080
pcm_file->substream = substream;
20842081
if (substream->ref_count == 1) {
2085-
str = substream->pstr;
20862082
substream->file = pcm_file;
20872083
substream->pcm_release = pcm_release_private;
20882084
}
@@ -3024,11 +3020,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_status =
30243020
static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file,
30253021
struct vm_area_struct *area)
30263022
{
3027-
struct snd_pcm_runtime *runtime;
30283023
long size;
30293024
if (!(area->vm_flags & VM_READ))
30303025
return -EINVAL;
3031-
runtime = substream->runtime;
30323026
size = area->vm_end - area->vm_start;
30333027
if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)))
30343028
return -EINVAL;
@@ -3063,11 +3057,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_control =
30633057
static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file,
30643058
struct vm_area_struct *area)
30653059
{
3066-
struct snd_pcm_runtime *runtime;
30673060
long size;
30683061
if (!(area->vm_flags & VM_READ))
30693062
return -EINVAL;
3070-
runtime = substream->runtime;
30713063
size = area->vm_end - area->vm_start;
30723064
if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)))
30733065
return -EINVAL;

‎sound/core/seq/seq_queue.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,11 @@ int snd_seq_queue_timer_open(int queueid)
467467
int snd_seq_queue_timer_close(int queueid)
468468
{
469469
struct snd_seq_queue *queue;
470-
struct snd_seq_timer *tmr;
471470
int result = 0;
472471

473472
queue = queueptr(queueid);
474473
if (queue == NULL)
475474
return -EINVAL;
476-
tmr = queue->timer;
477475
snd_seq_timer_close(queue);
478476
queuefree(queue);
479477
return result;

0 commit comments

Comments
 (0)