ALSA: hda - Fix another cache list management

Fix another silly bug in the amp cache list management.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2008-11-10 16:24:26 +01:00
parent 0edb945430
commit f43aa025b7
2 changed files with 13 additions and 4 deletions

View File

@@ -539,6 +539,16 @@ static inline void snd_array_init(struct snd_array *array, unsigned int size,
array->alloc_align = align;
}
static inline void *snd_array_elem(struct snd_array *array, unsigned int idx)
{
return array->list + idx * array->elem_size;
}
static inline unsigned int snd_array_index(struct snd_array *array, void *ptr)
{
return (unsigned long)(ptr - array->list) / array->elem_size;
}
/*
* Structures
*/