aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-11-10 10:24:26 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-10 10:24:26 -0500
commitf43aa025b7de79d6a615ea4c1e6be7e6b1cea538 (patch)
treea359813d1476c158141a3c7f9bccde850bd73aaa /sound/pci/hda/hda_codec.h
parent0edb94543092535a2c6ef33e7285004168ca73d7 (diff)
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>
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r--sound/pci/hda/hda_codec.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index a73f0eb99283..ee122b009fd4 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -539,6 +539,16 @@ static inline void snd_array_init(struct snd_array *array, unsigned int size,
539 array->alloc_align = align; 539 array->alloc_align = align;
540} 540}
541 541
542static inline void *snd_array_elem(struct snd_array *array, unsigned int idx)
543{
544 return array->list + idx * array->elem_size;
545}
546
547static inline unsigned int snd_array_index(struct snd_array *array, void *ptr)
548{
549 return (unsigned long)(ptr - array->list) / array->elem_size;
550}
551
542/* 552/*
543 * Structures 553 * Structures
544 */ 554 */