fp@2126: $Id$ fp@2126: fp@2126: vim: spelllang=en tw=78 fp@2126: fp@2126: This is a short introduction to the coding style that shall be used. The below fp@2126: rules are applicable for all C source files, except the Ethernet drivers, for fp@2126: which the Linux Kernel coding style shall be used to minimize the fp@2126: differences). fp@2126: fp@2126: * Lines shall not exceed 78 characters. fp@2126: fp@2126: * Indentation shall be done using 4 space characters fp@2126: fp@2126: * No whitespace shall be left at the end of a line. fp@2126: fp@2126: * After a comma, a single space shall be placed (if not followed by a fp@2126: line break). fp@2126: fp@2126: * Braces shall be placed in the following way (K&R style): fp@2126: fp@2126: if (...) { fp@2126: ... fp@2126: } else if (...) { fp@2126: ... fp@2126: } else { fp@2126: ... fp@2126: } fp@2126: fp@2126: int function(...) fp@2126: { fp@2126: ... fp@2126: } fp@2126: fp@2126: * Macros shall be named in CAPITAL letters. If a macro contains multiple fp@2126: statements, they should be enclosed by a 'do {} while (0)' loop. Macro fp@2126: parameters shall also be capital letters and shall be enclosed py parantheses fp@2126: if necessary. fp@2126: fp@2126: #define MACRO(A, B) \ fp@2126: do { \ fp@2126: if ((A) == 1) { \ fp@2126: statement(B); \ fp@2126: } while (0) fp@2126: