Skip to content

Commit

Permalink
xhci: use (1u << i)
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
kraxel committed Aug 29, 2014
1 parent cae7f29 commit 3d80365
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/usb/hcd-xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ static int xhci_epmask_to_eps_with_streams(XHCIState *xhci,
slot = &xhci->slots[slotid - 1];

for (i = 2, j = 0; i <= 31; i++) {
if (!(epmask & (1 << i))) {
if (!(epmask & (1u << i))) {
continue;
}

Expand Down Expand Up @@ -2465,7 +2465,7 @@ static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid,
res = xhci_alloc_device_streams(xhci, slotid, ictl_ctx[1]);
if (res != CC_SUCCESS) {
for (i = 2; i <= 31; i++) {
if (ictl_ctx[1] & (1 << i)) {
if (ictl_ctx[1] & (1u << i)) {
xhci_disable_ep(xhci, slotid, i);
}
}
Expand Down

0 comments on commit 3d80365

Please sign in to comment.