mirror of https://github.com/xqemu/xqemu.git
hw/ide/ahci.c: Avoid shift left into sign bit
Add U suffix to avoid shifting left into the sign bit, which is undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
86e117724a
commit
ee25595f01
|
@ -438,9 +438,9 @@ static void check_cmd(AHCIState *s, int port)
|
||||||
|
|
||||||
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
|
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
|
||||||
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
|
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
|
||||||
if ((pr->cmd_issue & (1 << slot)) &&
|
if ((pr->cmd_issue & (1U << slot)) &&
|
||||||
!handle_cmd(s, port, slot)) {
|
!handle_cmd(s, port, slot)) {
|
||||||
pr->cmd_issue &= ~(1 << slot);
|
pr->cmd_issue &= ~(1U << slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue