Re[2]: [zd1211-devs] Re: [patch] updates to zd1211ng for 2.6(.11)
Status: Beta
Brought to you by:
mayne
From: Dan S. <dds...@ie...> - 2005-06-22 17:20:44
|
On Wed, 22 Jun 2005, Roman K wrote: >Hi, > >> >> name. Are there any examples, maybe that would make it clearer to me...? >> > >> >There was one, please refer to the original reply by Dmitriy. >> >> I'll look again, although I didn't see it the first time I read the >> email... > >That was RF_ => _RF change for example or ZD_ADAPTER rename. Ah, ok. I changed RFMD_RF for 2 reasons: 1) there were no defines for the other modes, they were all magic numbers, so I created those and renamed RFMD_RF to match 2) it is (IMHO at least) much more useful to have the generic part of a define _before_ the specific part. For example defining all RF modes as: RFMD_RF AIROHA_RF WHATEVER_RF is not as good as defining them as: RF_RFMD RF_AIROHA RF_WHATEVER since the prefix immediately tells you the define is describing a RF mode. I do not normally see defines with a type-suffix. I changed ZD_ADAPTER for three reasons: 1) ZD is a meaningless prefix, since we already know this is a zd1211 device :) 2) ADAPTER is a meaningful prefix, it tells you the define describes the type of ADAPTER 3) The specification described the two possible types of adapters as "normal" and "dongle". So to me, it makes sense to name the defines to match the specification. When I see "ZD_ADAPTER" that doesn't tell me if it matches the "normal" adapter or "dongle" adapter, until I go find that "ZD_DONGLE" is also defined, and then by process of elimination I figure "ZD_ADAPTER" _probably means_ the "normal" adapter. Not good naming practice... Of course you could go with "ZD_ADAPTER_NORMAL" and "ZD_ADAPTER_DONGLE", but again, ZD_ doesn't really add any useful information, does it? Unless, of course, you prefix ALL the zd1211 defines with ZD_, to indicate it's a zd1211 specific constant. But I don't think there is anything in the .h file that warrants it being put into include/linux/ and so I don't think anyone besides the zd1211 driver should need to include it, and so we're back to ZD_ not being a useful prefix :-) -- Dan Streetman dds...@ie... --------------------- 186,272 miles per second: It isn't just a good idea, it's the law! |