From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn2Ey-0001HT-RR for qemu-devel@nongnu.org; Wed, 21 May 2014 04:51:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn2Eu-0002BV-2A for qemu-devel@nongnu.org; Wed, 21 May 2014 04:51:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn2Et-0002BO-QO for qemu-devel@nongnu.org; Wed, 21 May 2014 04:51:07 -0400 From: Gerd Hoffmann Date: Wed, 21 May 2014 10:50:37 +0200 Message-Id: <1400662237-23743-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1400662237-23743-1-git-send-email-kraxel@redhat.com> References: <1400662237-23743-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/2] hw/audio/intel-hda: Avoid shift into sign bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , "Vassili Karpov (malc)" , Gerd Hoffmann From: Peter Maydell Add a U suffix to avoid shifting into the sign bit (which is undefined behaviour in C). Signed-off-by: Peter Maydell Signed-off-by: Gerd Hoffmann --- hw/audio/intel-hda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 9e075c0..3cfb66c 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; -- 1.8.3.1