From f43aa025b7de79d6a615ea4c1e6be7e6b1cea538 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 10 Nov 2008 16:24:26 +0100 Subject: ALSA: hda - Fix another cache list management Fix another silly bug in the amp cache list management. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sound/pci/hda/hda_codec.h') diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index a73f0eb9928..ee122b009fd 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 */ -- cgit v1.2.3