All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] usb: core: log more general message on malformed LANGID descriptor
@ 2014-09-23 22:28 Scot Doyle
  2014-09-24  5:27 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Scot Doyle @ 2014-09-23 22:28 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman, Sarah Sharp, Dan Williams
  Cc: Daniel Mack, linux-usb, linux-kernel

I'd like to change this error message:
[    3.325837] usb 1-4: string descriptor 0 malformed (err = -61), defaulting to 0x0409

into an error message followed by a debug message:
[    3.324726] usb 1-4: malformed string descriptor; unknown language, defaulting to English
[    3.327514] usb 1-4: string descriptor 0 malformed (err = -61), defaulting to 0x0409

in order to communicate more information from the log itself. Are there 
any problems with this approach? Would it be better to put all the 
information on a single line? Something else?


---
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 0c8a7fc..c29eb37 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -770,6 +770,8 @@ static int usb_get_langid(struct usb_device *dev, unsigned char *tbuf)
 		dev->string_langid = 0x0409;
 		dev->have_langid = 1;
 		dev_err(&dev->dev,
+			"malformed string descriptor; unknown language, defaulting to English");
+		dev_dbg(&dev->dev,
 			"string descriptor 0 malformed (err = %d), "
 			"defaulting to 0x%04x\n",
 				err, dev->string_langid);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] usb: core: log more general message on malformed LANGID descriptor
  2014-09-23 22:28 [RFC PATCH] usb: core: log more general message on malformed LANGID descriptor Scot Doyle
@ 2014-09-24  5:27 ` Greg Kroah-Hartman
  2014-09-24 17:28   ` Scot Doyle
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2014-09-24  5:27 UTC (permalink / raw)
  To: Scot Doyle
  Cc: Alan Stern, Sarah Sharp, Dan Williams, Daniel Mack, linux-usb,
	linux-kernel

On Tue, Sep 23, 2014 at 10:28:49PM +0000, Scot Doyle wrote:
> I'd like to change this error message:
> [    3.325837] usb 1-4: string descriptor 0 malformed (err = -61), defaulting to 0x0409
> 
> into an error message followed by a debug message:
> [    3.324726] usb 1-4: malformed string descriptor; unknown language, defaulting to English
> [    3.327514] usb 1-4: string descriptor 0 malformed (err = -61), defaulting to 0x0409
> 
> in order to communicate more information from the log itself. Are there 
> any problems with this approach? Would it be better to put all the 
> information on a single line? Something else?

How about just one line, why two?

And something like "device not implementing langid specifier, defaulting
to English", but cleaned up to sound a bit better?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] usb: core: log more general message on malformed LANGID descriptor
  2014-09-24  5:27 ` Greg Kroah-Hartman
@ 2014-09-24 17:28   ` Scot Doyle
  0 siblings, 0 replies; 3+ messages in thread
From: Scot Doyle @ 2014-09-24 17:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Alan Stern, Sarah Sharp, Dan Williams, Daniel Mack, linux-usb,
	linux-kernel

On Tue, 23 Sep 2014, Greg Kroah-Hartman wrote:

> On Tue, Sep 23, 2014 at 10:28:49PM +0000, Scot Doyle wrote:
>> I'd like to change this error message:
>> [    3.325837] usb 1-4: string descriptor 0 malformed (err = -61), defaulting to 0x0409
>>
>> into an error message followed by a debug message:
>> [    3.324726] usb 1-4: malformed string descriptor; unknown language, defaulting to English
>> [    3.327514] usb 1-4: string descriptor 0 malformed (err = -61), defaulting to 0x0409
>>
>> in order to communicate more information from the log itself. Are there
>> any problems with this approach? Would it be better to put all the
>> information on a single line? Something else?
>
> How about just one line, why two?
>
> And something like "device not implementing langid specifier, defaulting
> to English", but cleaned up to sound a bit better?

That sounds good, I plan to submit this patch tomorrow unless anyone 
prefers different wording.

---
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 0c8a7fc..5317081 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -770,9 +770,7 @@ static int usb_get_langid(struct usb_device *dev, unsigned char *tbuf)
 		dev->string_langid = 0x0409;
 		dev->have_langid = 1;
 		dev_err(&dev->dev,
-			"string descriptor 0 malformed (err = %d), "
-			"defaulting to 0x%04x\n",
-				err, dev->string_langid);
+			"language id specifier not provided by device, defaulting to English");
 		return 0;
 	}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-24 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 22:28 [RFC PATCH] usb: core: log more general message on malformed LANGID descriptor Scot Doyle
2014-09-24  5:27 ` Greg Kroah-Hartman
2014-09-24 17:28   ` Scot Doyle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.