Bug 218762 - USB string order in dmesg
Summary: USB string order in dmesg
Status: RESOLVED ANSWERED
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P3 enhancement
Assignee: Default virtual assignee for Drivers/USB
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-22 19:34 UTC by Max
Modified: 2024-04-23 15:33 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Max 2024-04-22 19:34:17 UTC
Hi,

Is there any good reason why the code https://github.com/torvalds/linux/blob/c85af715cac0a951eea97393378e84bb49384734/drivers/usb/core/hub.c#L2361 is declaring string (show_string) values in a different order than they are specified in dev_info?

	dev_info(&udev->dev,
		"New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
		udev->descriptor.iManufacturer,
		udev->descriptor.iProduct,
		udev->descriptor.iSerialNumber);
	show_string(udev, "Product", udev->product);
	show_string(udev, "Manufacturer", udev->manufacturer);
	show_string(udev, "SerialNumber", udev->serial);


Now
usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 4-1: Product: BM5100ADW series
usb 4-1: Manufacturer: Pantum
usb 4-1: SerialNumber: CK1A8823765

Expected
usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 4-1: Manufacturer: Pantum
usb 4-1: Product: BM5100ADW series
usb 4-1: SerialNumber: CK1A8823765
Comment 1 gregkh 2024-04-23 11:31:29 UTC
On Mon, Apr 22, 2024 at 07:34:17PM +0000, bugzilla-daemon@kernel.org wrote:
> Is there any good reason why the code
>
> https://github.com/torvalds/linux/blob/c85af715cac0a951eea97393378e84bb49384734/drivers/usb/core/hub.c#L2361
> is declaring string (show_string) values in a different order than they are
> specified in dev_info?
> 
>         dev_info(&udev->dev,
>                 "New USB device strings: Mfr=%d, Product=%d,
> SerialNumber=%d\n",
>                 udev->descriptor.iManufacturer,
>                 udev->descriptor.iProduct,
>                 udev->descriptor.iSerialNumber);
>         show_string(udev, "Product", udev->product);
>         show_string(udev, "Manufacturer", udev->manufacturer);
>         show_string(udev, "SerialNumber", udev->serial);
> 
> 
> Now
> usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 4-1: Product: BM5100ADW series
> usb 4-1: Manufacturer: Pantum
> usb 4-1: SerialNumber: CK1A8823765
> 
> Expected
> usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 4-1: Manufacturer: Pantum
> usb 4-1: Product: BM5100ADW series
> usb 4-1: SerialNumber: CK1A8823765

No specific reaason, just has always been that way for 20+ years and no
one has noticed.

Note You need to log in before you can comment on or make changes to this bug.