[U-Boot] [PATCH v3 5/7] usb: add usb_int_msg_nonblock

Marek Vasut marex at denx.de
Fri Jul 12 04:02:54 UTC 2019


On 7/10/19 5:52 PM, Michal Suchánek wrote:
> On Fri, 5 Jul 2019 14:13:50 +0200
> Marek Vasut <marex at denx.de> wrote:
> 
>> On 7/5/19 12:44 PM, Michal Suchanek wrote:
>>> Variant of the int_msg wrapper that does not introduce excessive retry
>>> delay on error.
>>>
>>> Signed-off-by: Michal Suchanek <msuchanek at suse.de>
>>> ---
>>> v2: usb_submit_int_msg -> usb_int_msg
>>> ---
>>>  common/usb.c  | 9 +++++++++
>>>  include/usb.h | 2 ++
>>>  2 files changed, 11 insertions(+)
>>>
>>> diff --git a/common/usb.c b/common/usb.c
>>> index f57c0e8cdf57..1bd60b24a555 100644
>>> --- a/common/usb.c
>>> +++ b/common/usb.c
>>> @@ -200,6 +200,15 @@ int usb_int_msg(struct usb_device *dev, unsigned long pipe,
>>>  	return submit_int_msg(dev, pipe, buffer, transfer_len, interval, false);
>>>  }
>>>  
>>> +/*
>>> + * submits an Interrupt Message without retry
>>> + */
>>> +int usb_int_msg_nonblock(struct usb_device *dev, unsigned long pipe,
>>> +			void *buffer, int transfer_len, int interval)
>>> +{
>>> +	return submit_int_msg(dev, pipe, buffer, transfer_len, interval, true);
>>> +}  
>>
>> Wouldn't it be shorter to just call submit_int_msg() directly, with the
>> extra parameter ?
> 
> It is easier to understand the change this way. The idea is that only
> some very specific callers need to know about the difference.

It's just another layer of meaningless obfuscation. Explain what the
parameter does in a comment and be done with it.


More information about the U-Boot mailing list