Merge branch 'topic/div64-cleanup' into for-linus

* topic/div64-cleanup:
  ALSA: Clean up 64bit division functions
This commit is contained in:
Takashi Iwai
2009-06-10 07:26:28 +02:00
5 changed files with 9 additions and 84 deletions

View File

@@ -31,6 +31,7 @@
#include <linux/time.h>
#include <linux/vmalloc.h>
#include <linux/moduleparam.h>
#include <linux/math64.h>
#include <linux/string.h>
#include <sound/core.h>
#include <sound/minors.h>
@@ -617,9 +618,7 @@ static long snd_pcm_oss_bytes(struct snd_pcm_substream *substream, long frames)
#else
{
u64 bsize = (u64)runtime->oss.buffer_bytes * (u64)bytes;
u32 rem;
div64_32(&bsize, buffer_size, &rem);
return (long)bsize;
return div_u64(bsize, buffer_size);
}
#endif
}

View File

@@ -22,6 +22,7 @@
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/math64.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
@@ -452,7 +453,7 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b,
*r = 0;
return UINT_MAX;
}
div64_32(&n, c, r);
n = div_u64_rem(n, c, r);
if (n >= UINT_MAX) {
*r = 0;
return UINT_MAX;