提交 e25e62ae 编写于 作者: S Sarah Sharp

xhci: Fix error path return value.

This patch fixes an issue discovered by Dan Carpenter:

The patch 3b3db026: "xhci: Add infrastructure for host-specific
LPM policies." from May 9, 2012, leads to the following warning:
drivers/usb/host/xhci.c:3909 xhci_get_timeout_no_hub_lpm()
         warn: signedness bug returning '-22'

  3906          default:
  3907                  dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n",
  3908                                  __func__);
  3909                  return -EINVAL;
                        ^^^^^^^^^^^^^^
This should be a u16 like USB3_LPM_DISABLED or something.

  3910          }
  3911
  3912          if (sel <= max_sel_pel && pel <= max_sel_pel)
  3913                  return USB3_LPM_DEVICE_INITIATED;
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
上级 55558c33
......@@ -3906,7 +3906,7 @@ static u16 xhci_get_timeout_no_hub_lpm(struct usb_device *udev,
default:
dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n",
__func__);
return -EINVAL;
return USB3_LPM_DISABLED;
}
if (sel <= max_sel_pel && pel <= max_sel_pel)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册