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