diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-10 10:24:26 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-10 10:24:26 -0500 |
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 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 | ||
542 | static inline void *snd_array_elem(struct snd_array *array, unsigned int idx) | ||
543 | { | ||
544 | return array->list + idx * array->elem_size; | ||
545 | } | ||
546 | |||
547 | static 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 | */ |