Skip to contentSkip to conversation

usb: core: log more general message on malformed LANGID descriptor

RFC PATCH In review Scot Doyle 2 participants 3 messages Sep 23, 2014 – Sep 24, 2014 USB

lore
Share & tools
lore

Scot Doyle

author
#0 lore raw

RFC PATCH 1/1 usb: core: log more general message on malformed LANGID descriptor

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?

---

drivers/usb/core/message.c +2 -0
index 0c8a7fc..c29eb37 100644
@@ -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);
#1 lore raw
Quoted 10 lines · Scot Doyle

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

author
#2 lore raw
Quoted 8 lines · Greg Kroah-Hartman
Quoted 7 lines · Scot Doyle

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
Quoted 8 lines
Quoted 3 lines

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.

---

drivers/usb/core/message.c +1 -3
index 0c8a7fc..5317081 100644
@@ -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;
 	}