[Nut-upsdev] [nut-commits] svn commit r1578 - in trunk: . drivers

Arnaud Quette aquette.dev at gmail.com
Wed Nov 26 15:16:58 UTC 2008


Hi Arjen,

2008/11/24 Arjen de Korte <nut+devel at de-korte.org>:
> Citeren Arnaud Quette <aquette.dev at gmail.com>:
>
>> the use of defines for VendorID is due to the fact that that way, we
>> can extract the comment on the line before the #define (Vendor Name,
>> ex Agiler), and keep the one above the device declaration
>> (USB_DEVICE...) for the device (ex  Agiler UPS).
>
> Thats a flawed strategy from the start. :-) We already know that some
> VendorIDs will have a much larger set of devices, especially in the world of
> USB to serial converters where this driver lives. For instance, what we now
> call BELKIN_VENDORID, is in fact the vendor ID of Cypress Semiconductor, for
> which we know in the mean time that there loads of OEMs that use it.
> Although this looked like a good idea, it doesn't work.

fully right (and I should enough be aware as the proxy of these info!).
btw, can't you develop an "Arjen plugin for GMail" so that my current
recurrent nonsense can be caught before I hit send? ;-)

>> though that's purely informative and cosmetic, it may be useful...
>
> The reason why I removed this here, is the fact that over-use of defines
> makes code more difficult, instead easier to understand.

I strongly disagree there. VENDOR_NAME is always more informative than 0x????

> What we're matching
> here, is a combination of VID:PID. When users report 'new' models, these
> will invariably be in hexadecimal (as reported by 'lsusb') format. This
> table should reflect this, so that it is immediately clear when looking at
> it if a combination is new or not. Using defines obfuscates this.

agreed

> So while I agree that automatic extraction of information from the code is
> useful, in this case I think you went one step too far. Extracting this on a
> VID:PID level is as far as I would like to take this (and even then we
> should remember that there will be an awful lot of duplicates).

mostly agree.
the idea behind extracting also vendor and model names is to have some
cross references in these generated files, to point a driver/sub
driver more easily (that is to say without having to grep).

but a well formated device comment is sufficient...

-- Arnaud



More information about the Nut-upsdev mailing list