USB cleanup ideas

Matthew Dillon dillon at
Mon Jun 25 22:22:27 PDT 2007

:While looking at improving some USB stuff I noticed how many obfuscating
:macros are used in the code. Although I can see how it was meant to make
:sharing of code easier between BSDs, it isn't the case any mode - FreeBSD
:and OpenBSD already removed most of these macros. So, I'd like to do some
:cleaning at first to ease bringing in changes from other BSDs - ie. nuke
:this obfuscating stuff.
:For start I cleaned up sys/bus/usb/usb_port.h. I don't think that it
:makes much sense to have the code not used by us in headers (see attached
:patch). I intend to continue with mechanical cleanup at first: nuke
:device_ptr_t, USBBASEDEVICE, USBDEV etc. Or is there any objections?
:Note, that I don't intend to remove macros from usb_port.h header itself.
:Having these macros in the header makes still sense for porting drivers
:from NetBSD, compiling older out of tree drivers etc.
:Also, if someone steps up and says "this is something for me and I'd like
:to work on this", I'd be more than happy - I have plenty of other ideas -
: ;).
:Hasso Tepper

    Oooh, someone actually wants to clean up USB!  Go for it!  Those
    macros drive me nuts.


More information about the Kernel mailing list