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/isa | |
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/isa')
-rw-r--r-- | sound/isa/gus/gus_mem.c | 7 | ||||
-rw-r--r-- | sound/isa/wavefront/wavefront_synth.c | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c index f50c276caee8..7107753b85b5 100644 --- a/sound/isa/gus/gus_mem.c +++ b/sound/isa/gus/gus_mem.c | |||
@@ -143,9 +143,8 @@ static int snd_gf1_mem_find(struct snd_gf1_mem * alloc, | |||
143 | struct snd_gf1_mem_block *pblock; | 143 | struct snd_gf1_mem_block *pblock; |
144 | unsigned int ptr1, ptr2; | 144 | unsigned int ptr1, ptr2; |
145 | 145 | ||
146 | align--; | 146 | if (w_16 && align < 2) |
147 | if (w_16 && align < 1) | 147 | align = 2; |
148 | align = 1; | ||
149 | block->flags = w_16 ? SNDRV_GF1_MEM_BLOCK_16BIT : 0; | 148 | block->flags = w_16 ? SNDRV_GF1_MEM_BLOCK_16BIT : 0; |
150 | block->owner = SNDRV_GF1_MEM_OWNER_DRIVER; | 149 | block->owner = SNDRV_GF1_MEM_OWNER_DRIVER; |
151 | block->share = 0; | 150 | block->share = 0; |
@@ -165,7 +164,7 @@ static int snd_gf1_mem_find(struct snd_gf1_mem * alloc, | |||
165 | if (pblock->next->ptr < boundary) | 164 | if (pblock->next->ptr < boundary) |
166 | ptr2 = pblock->next->ptr; | 165 | ptr2 = pblock->next->ptr; |
167 | } | 166 | } |
168 | ptr1 = (pblock->ptr + pblock->size + align) & ~align; | 167 | ptr1 = ALIGN(pblock->ptr + pblock->size, align); |
169 | if (ptr1 >= ptr2) | 168 | if (ptr1 >= ptr2) |
170 | continue; | 169 | continue; |
171 | size1 = ptr2 - ptr1; | 170 | size1 = ptr2 - ptr1; |
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index bed329edbdd7..78020d832e04 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c | |||
@@ -1068,7 +1068,7 @@ wavefront_send_sample (snd_wavefront_t *dev, | |||
1068 | blocksize = max_blksize; | 1068 | blocksize = max_blksize; |
1069 | } else { | 1069 | } else { |
1070 | /* round to nearest 16-byte value */ | 1070 | /* round to nearest 16-byte value */ |
1071 | blocksize = ((length-written+7)&~0x7); | 1071 | blocksize = ALIGN(length - written, 8); |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) { | 1074 | if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) { |