diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-10 16:24:26 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-10 16:24:26 +0100 |
commit | f43aa025b7de79d6a615ea4c1e6be7e6b1cea538 (patch) | |
tree | a359813d1476c158141a3c7f9bccde850bd73aaa /sound/pci/hda/hda_codec.h | |
parent | 0edb94543092535a2c6ef33e7285004168ca73d7 (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.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 */ |