--- linux-2.3.46/Documentation/CodingStyle Thu Feb 17 20:45:35 2000 +++ linux-2.3.46/Documentation/CodingStyle.new Thu Feb 17 20:43:07 2000 @@ -233,3 +233,26 @@ stable. All options that are known to trash data (experimental write- support for file-systems, for instance) should be denoted (DANGEROUS), other Experimental options should be denoted (EXPERIMENTAL). + + + Chapter 8: Struct Initializations + +Struct initializations should use named syntax. It makes for cleaner, +more compact, self-documenting and more readable code and allows later +reordering of struct members (for example, to help cache behavior). +It also allows new struct members to be introduced where they make the +most sense (say, in the same cache line as other members they are likely +to be access with). + +Since the official kernel compiler is gcc 2.7.2.3, that syntax is +currently the preferred method. It is worth noting that C99 syntax +(.field = initializer,) is also accepted by this compiler. + +struct struct_type foo = { + field1: initializer1, + field2: initializer2, + field3: initializer3, +} + +The trailing comma on the last line allows for a homogenous look and easy +rearrangement (eg for later blocking of some members in an #ifdef).