summary refs log tree commit diff stats
path: root/hw/audio/intel-hda.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-05-09 14:22:53 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-05-20 08:49:21 +0200
commitb1fe60cd3525871a4c593ad8c2b39b89c19c00d0 (patch)
tree07c3912eb20610e28a3095ab4236739b41ab24b2 /hw/audio/intel-hda.c
parenta2554a334a92db72547a8d15e9d00dc3d37dd3a1 (diff)
downloadfocaccia-qemu-b1fe60cd3525871a4c593ad8c2b39b89c19c00d0.tar.gz
focaccia-qemu-b1fe60cd3525871a4c593ad8c2b39b89c19c00d0.zip
hw/audio/intel-hda: Avoid shift into sign bit
Add a U suffix to avoid shifting into the sign bit (which is
undefined behaviour in C).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/audio/intel-hda.c')
-rw-r--r--hw/audio/intel-hda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 9e075c0137..3cfb66c5d8 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -245,7 +245,7 @@ static void intel_hda_update_int_sts(IntelHDAState *d)
 
     /* update global status */
     if (sts & d->int_ctl) {
-        sts |= (1 << 31);
+        sts |= (1U << 31);
     }
 
     d->int_sts = sts;
@@ -257,7 +257,7 @@ static void intel_hda_update_irq(IntelHDAState *d)
     int level;
 
     intel_hda_update_int_sts(d);
-    if (d->int_sts & (1 << 31) && d->int_ctl & (1 << 31)) {
+    if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) {
         level = 1;
     } else {
         level = 0;