提交 b1fe60cd 编写于 作者: P Peter Maydell 提交者: Gerd Hoffmann

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: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 a2554a33
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册