diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2006-10-09 02:13:32 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@server.perex.cz> | 2006-12-20 02:55:36 -0500 |
commit | 7ab399262ee636d19db5163a35ac406d5b892a0a (patch) | |
tree | 6cfe6267feb4a8d56114e282d41b683946c6eaf0 /sound/pci/ymfpci/ymfpci_main.c | |
parent | e7d24f0bbd0eb0d9a6d337ef67d5e2ad78900488 (diff) |
[ALSA] use the ALIGN macro
Use the ALIGN macro instead of manual calculations.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/ymfpci/ymfpci_main.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index a40c1085fd20..79c58f3a6b7c 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -2025,10 +2025,10 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | |||
2025 | chip->bank_size_effect = snd_ymfpci_readl(chip, YDSXGR_EFFCTRLSIZE) << 2; | 2025 | chip->bank_size_effect = snd_ymfpci_readl(chip, YDSXGR_EFFCTRLSIZE) << 2; |
2026 | chip->work_size = YDSXG_DEFAULT_WORK_SIZE; | 2026 | chip->work_size = YDSXG_DEFAULT_WORK_SIZE; |
2027 | 2027 | ||
2028 | size = ((playback_ctrl_size + 0x00ff) & ~0x00ff) + | 2028 | size = ALIGN(playback_ctrl_size, 0x100) + |
2029 | ((chip->bank_size_playback * 2 * YDSXG_PLAYBACK_VOICES + 0x00ff) & ~0x00ff) + | 2029 | ALIGN(chip->bank_size_playback * 2 * YDSXG_PLAYBACK_VOICES, 0x100) + |
2030 | ((chip->bank_size_capture * 2 * YDSXG_CAPTURE_VOICES + 0x00ff) & ~0x00ff) + | 2030 | ALIGN(chip->bank_size_capture * 2 * YDSXG_CAPTURE_VOICES, 0x100) + |
2031 | ((chip->bank_size_effect * 2 * YDSXG_EFFECT_VOICES + 0x00ff) & ~0x00ff) + | 2031 | ALIGN(chip->bank_size_effect * 2 * YDSXG_EFFECT_VOICES, 0x100) + |
2032 | chip->work_size; | 2032 | chip->work_size; |
2033 | /* work_ptr must be aligned to 256 bytes, but it's already | 2033 | /* work_ptr must be aligned to 256 bytes, but it's already |
2034 | covered with the kernel page allocation mechanism */ | 2034 | covered with the kernel page allocation mechanism */ |
@@ -2043,8 +2043,8 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | |||
2043 | chip->bank_base_playback_addr = ptr_addr; | 2043 | chip->bank_base_playback_addr = ptr_addr; |
2044 | chip->ctrl_playback = (u32 *)ptr; | 2044 | chip->ctrl_playback = (u32 *)ptr; |
2045 | chip->ctrl_playback[0] = cpu_to_le32(YDSXG_PLAYBACK_VOICES); | 2045 | chip->ctrl_playback[0] = cpu_to_le32(YDSXG_PLAYBACK_VOICES); |
2046 | ptr += (playback_ctrl_size + 0x00ff) & ~0x00ff; | 2046 | ptr += ALIGN(playback_ctrl_size, 0x100); |
2047 | ptr_addr += (playback_ctrl_size + 0x00ff) & ~0x00ff; | 2047 | ptr_addr += ALIGN(playback_ctrl_size, 0x100); |
2048 | for (voice = 0; voice < YDSXG_PLAYBACK_VOICES; voice++) { | 2048 | for (voice = 0; voice < YDSXG_PLAYBACK_VOICES; voice++) { |
2049 | chip->voices[voice].number = voice; | 2049 | chip->voices[voice].number = voice; |
2050 | chip->voices[voice].bank = (struct snd_ymfpci_playback_bank *)ptr; | 2050 | chip->voices[voice].bank = (struct snd_ymfpci_playback_bank *)ptr; |
@@ -2055,8 +2055,8 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | |||
2055 | ptr_addr += chip->bank_size_playback; | 2055 | ptr_addr += chip->bank_size_playback; |
2056 | } | 2056 | } |
2057 | } | 2057 | } |
2058 | ptr = (char *)(((unsigned long)ptr + 0x00ff) & ~0x00ff); | 2058 | ptr = (char *)ALIGN((unsigned long)ptr, 0x100); |
2059 | ptr_addr = (ptr_addr + 0x00ff) & ~0x00ff; | 2059 | ptr_addr = ALIGN(ptr_addr, 0x100); |
2060 | chip->bank_base_capture = ptr; | 2060 | chip->bank_base_capture = ptr; |
2061 | chip->bank_base_capture_addr = ptr_addr; | 2061 | chip->bank_base_capture_addr = ptr_addr; |
2062 | for (voice = 0; voice < YDSXG_CAPTURE_VOICES; voice++) | 2062 | for (voice = 0; voice < YDSXG_CAPTURE_VOICES; voice++) |
@@ -2065,8 +2065,8 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | |||
2065 | ptr += chip->bank_size_capture; | 2065 | ptr += chip->bank_size_capture; |
2066 | ptr_addr += chip->bank_size_capture; | 2066 | ptr_addr += chip->bank_size_capture; |
2067 | } | 2067 | } |
2068 | ptr = (char *)(((unsigned long)ptr + 0x00ff) & ~0x00ff); | 2068 | ptr = (char *)ALIGN((unsigned long)ptr, 0x100); |
2069 | ptr_addr = (ptr_addr + 0x00ff) & ~0x00ff; | 2069 | ptr_addr = ALIGN(ptr_addr, 0x100); |
2070 | chip->bank_base_effect = ptr; | 2070 | chip->bank_base_effect = ptr; |
2071 | chip->bank_base_effect_addr = ptr_addr; | 2071 | chip->bank_base_effect_addr = ptr_addr; |
2072 | for (voice = 0; voice < YDSXG_EFFECT_VOICES; voice++) | 2072 | for (voice = 0; voice < YDSXG_EFFECT_VOICES; voice++) |
@@ -2075,8 +2075,8 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | |||
2075 | ptr += chip->bank_size_effect; | 2075 | ptr += chip->bank_size_effect; |
2076 | ptr_addr += chip->bank_size_effect; | 2076 | ptr_addr += chip->bank_size_effect; |
2077 | } | 2077 | } |
2078 | ptr = (char *)(((unsigned long)ptr + 0x00ff) & ~0x00ff); | 2078 | ptr = (char *)ALIGN((unsigned long)ptr, 0x100); |
2079 | ptr_addr = (ptr_addr + 0x00ff) & ~0x00ff; | 2079 | ptr_addr = ALIGN(ptr_addr, 0x100); |
2080 | chip->work_base = ptr; | 2080 | chip->work_base = ptr; |
2081 | chip->work_base_addr = ptr_addr; | 2081 | chip->work_base_addr = ptr_addr; |
2082 | 2082 | ||