Re: [PATCH 001/001] usbserial: New mobile broadband modems to be supported through option module

From: Oliver Neukum
Date: Sat Feb 07 2009 - 04:02:49 EST


Am Saturday 07 February 2009 00:47:16 schrieb Greg KH:

> > The specifity is not affected at all.
>
> If you look at the names that were changed, they are now more
> descriptive than before, always a good thing to have.

They are not descriptive. As far as USB devices have names,
these names _are_ the numbers. You will be very hard pressed
to guess from a name on a box that you may or may not have
which OEM's hardware really is in that box. If you have IDs
everything is clear. People who look at this code will mostly
have bug reports which will hopefully include lsusb, but not the
symbolic name in the kernel.

We dont do
*(base + 8) = 0xb3;
here. That would be bad. We use a clearly defined macro, USB_DEVICE
which takes id _numbers_. Device IDs have no meaning. They are meant
to be unique. You can give sensible names only to things that have meaning.

This is like doing
u8 init_string1[] = { INIT_STRING1_BYTE0, INIT_STRING1_BYTE1, ...

Don't make a fetish out of symbolic names.

Regards
Oliver

PS: Yes, I've had a professor who did prefer it this way.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/