xhci: move sanity checks
commitc590fe3aa23acb923159c41c741dd694cba9c544
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 5 Nov 2020 13:41:12 +0000 (5 14:41 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 16 Nov 2020 08:11:21 +0000 (16 09:11 +0100)
tree8810017e0b4db25f28955e18543b12ddd48343f7
parent22abfc96af0209fa58a7b9c13d60b2982db281c7
xhci: move sanity checks

The v variable goes negative for reg < 0x20.  Reorder the code
to first sanity check then calculate v and assign intr to make
sanity checkers happy.

Buglink: https://bugs.launchpad.net/qemu/+bug/1902112
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201105134112.25119-7-kraxel@redhat.com
hw/usb/hcd-xhci.c