[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200907150858.GD762136@rowland.harvard.edu>
Date: Mon, 7 Sep 2020 11:08:58 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: himadrispandya@...il.com, dvyukov@...gle.com,
linux-usb@...r.kernel.org, perex@...ex.cz, tiwai@...e.com,
stern@...land.harvard.ed, linux-kernel@...r.kernel.org,
marcel@...tmann.org, johan.hedberg@...il.com,
linux-bluetooth@...r.kernel.org, alsa-devel@...a-project.org
Subject: Re: [PATCH v2 04/11] USB: core: hub.c: use usb_control_msg_send() in
a few places
On Mon, Sep 07, 2020 at 04:51:01PM +0200, Greg Kroah-Hartman wrote:
> There are a few calls to usb_control_msg() that can be converted to use
> usb_control_msg_send() instead, so do that in order to make the error
> checking a bit simpler and the code smaller.
>
> Cc: Alan Stern <stern@...land.harvard.edu>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
> v2:
> - dropped changes to usb_req_set_sel() thanks to review from Alan
> @@ -4056,7 +4035,7 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
> * associated with the link state we're about to enable.
> */
> ret = usb_req_set_sel(udev, state);
> - if (ret < 0) {
> + if (ret) {
> dev_warn(&udev->dev, "Set SEL for device-initiated %s failed.\n",
> usb3_lpm_names[state]);
> return;
Did this change survive by mistake?
Actually, it looks like usb_req_set_sel needs to check the value
returned by usb_control_msg -- a perfect example of the sort of thing
you were trying to fix in the first place!
Alan Stern
Powered by blists - more mailing lists