On Wed, Aug 20, 2008 at 10:50:49AM -0700, John L. Utz III wrote:
On Wed, 20 Aug 2008 01:28:39 -0700, Takashi Iwai tiwai@suse.de wrote:
They must be consistent -- usually 0 = disable, 1 = enable. In general, the controls like "XXX Disable" is bad. A switch should be to turn on, not to turn off. If the register bit is to disable something, implement the control element in a reverse way.
OK.
note that it makes the code more complex in some places because the chip is inconsistent.
ASoC does this by having a flag in the control specific data saying if the control is inverted which works pretty well for dealing with this situation.
Avoid too long lines (also in other places).
OK. 80 column?
Yes. See Documentation/CodingStyle (and checkpatch).
Also, a Windows style variable name should be avoided. People tend to hate it.
Why would you call this 'Windows Style?' Is that supposed to be a perjorative comment?
This style is used throughout the Windows API documentation and is therefore frequently encounterd in Windows code but it's rarely encountered anywhere else. It's called Hungarian notation, though in the form it's normally seen it's very far from what was originally intended by that.
Having variable type decorations provides valuable context and (IMHO) makes the code more maintainable.
Many people have forcefuly held views in the opposite direction - google will turn up a bunch. I have the following in my fortune database:
prepAs nounOthers verbHave verbNoted, pronThis nounStyle verbIs verbCalled adjHungarian nounNotation. pronI verbFind pronIt advCompletely adjUseless. pronI verbHope pronYou verbCan verbSee possMy nounPoint -- verbEspecially nounWhen possThe advPrefixes conjBecome verbUtterly adjWrong. :-) -- Chris Torek nospam@elf.eng.bsdi.com