summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-11-10 16:24:26 +0100
committerTakashi Iwai <tiwai@suse.de>2008-11-10 16:24:26 +0100
commitf43aa025b7de79d6a615ea4c1e6be7e6b1cea538 (patch)
treea359813d1476c158141a3c7f9bccde850bd73aaa /sound/pci/hda/hda_codec.h
parent0edb94543092535a2c6ef33e7285004168ca73d7 (diff)
downloadlwn-f43aa025b7de79d6a615ea4c1e6be7e6b1cea538.tar.gz
lwn-f43aa025b7de79d6a615ea4c1e6be7e6b1cea538.zip
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,
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
*/