gregkh / usbutils

USB utilities for Linux, including lsusb
http://www.linux-usb.org
354 stars 199 forks source link

Bus sort order #161

Closed cbiedl closed 10 months ago

cbiedl commented 1 year ago

See Debian bug report #927188 (https://bugs.debian.org/927188): The lsusb seems to list busses in reverse order. For the simple mode (default), this can be fixed by adding sorter in list_devices (patch available upon request). For the tree mode (-t), I noticed the buses are sorted in reverse order by intention:

    static void sort_busses(void)
    {
            /* need to reverse sort bus numbers */

[lsusb-t.c:661]

This has been around since the introduction in 2009. While reversing the sort order is trivial - mind to explain the idea behind this?

gregkh commented 10 months ago

Should now be resolved, sort order is now low->high, not backwards. I can't remember why it was originally done that way, sorry.