Re: [PATCH] usbip: tools usbip_attach: Fix cryptic error messages

From: Shuah Khan
Date: Tue Feb 27 2018 - 17:51:52 EST


On 02/27/2018 03:45 PM, Krzysztof Opasiak wrote:
>
>
> On 02/27/2018 11:23 PM, Shuah Khan wrote:
>> Attach device error message is cryptic and useless. Fix it to be
>> informative.
>>
>> Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
>> ---
>> Â tools/usb/usbip/src/usbip_attach.c | 3 ++-
>> Â 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/usb/usbip/src/usbip_attach.c b/tools/usb/usbip/src/usbip_attach.c
>> index 7f07b2d50f59..f60738735398 100644
>> --- a/tools/usb/usbip/src/usbip_attach.c
>> +++ b/tools/usb/usbip/src/usbip_attach.c
>> @@ -195,7 +195,8 @@ static int attach_device(char *host, char *busid)
>> Â ÂÂÂÂÂ rhport = query_import_device(sockfd, busid);
>> ÂÂÂÂÂ if (rhport < 0) {
>> -ÂÂÂÂÂÂÂ err("query");
>> +ÂÂÂÂÂÂÂ err("Attach request for Device %s. Is this device exported?",
>> +ÂÂÂÂÂÂÂÂÂÂÂ busid);
>> ÂÂÂÂÂÂÂÂÂ return -1;
>> ÂÂÂÂÂ }
>
> The code itself is ok and you may put my:
>
> Reviewed-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
>
> but just because of my curiosity, there is a number of places in usbip tools where the same level of descriptiveness is used for error message. Why did you choose to fix this one not any other or all others?;)
>
> Best regards,

Yes there are several very cryptic and useless error message all over the
place in usbip tools that could use refinement. This just happens to be the
one that I seem to run into very frequently. It frustrated me enough that
I decided to fix this one first. :)

thanks,
-- Shuah