aboutsummaryrefslogtreecommitdiff
path: root/hw/audio/pcspk.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-22 13:04:16 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-31 12:29:07 +0200
commit668c2d1f91f467ae718fc3e03cffed25ade8bfce (patch)
treee1aa5dcf4ef3b34419947f5c0eff83c4ad8a69b8 /hw/audio/pcspk.c
parentec34748507c3eb812fe38afc59cc19a3bb713466 (diff)
pcspk: use QEMU_ALIGN_DOWN
I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw/audio/pcspk.c')
-rw-r--r--hw/audio/pcspk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index f643b122bb..0206f7399b 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -69,7 +69,7 @@ static inline void generate_samples(PCSpkState *s)
const uint32_t n = ((uint64_t)PIT_FREQ << 32) / m;
/* multiple of wavelength for gapless looping */
- s->samples = (PCSPK_BUF_LEN * PIT_FREQ / m * m / (PIT_FREQ >> 1) + 1) >> 1;
+ s->samples = (QEMU_ALIGN_DOWN(PCSPK_BUF_LEN * PIT_FREQ, m) / (PIT_FREQ >> 1) + 1) >> 1;
for (i = 0; i < s->samples; ++i)
s->sample_buf[i] = (64 & (n * i >> 25)) - 32;
} else {