CODING_STYLE: Mention preferred comment form
PATCH 1/1 CODING_STYLE: Mention preferred comment form
Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in CODING_STYLE.
--- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+)
CODING_STYLE +7 -0
@@ -116,3 +116,10 @@ if (a == 1) { Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this.
Signature · 1 line
2.7.4
Quoted 15 lines · Peter Maydell
Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in
CODING_STYLE.Suggested-by Thomas Huth <[email protected]>Signed-off-by Peter Maydell <[email protected]>--- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+)CODING_STYLE +0
-0
CODING_STYLE if (a == 1) { · line 125
Quoted 10 lines
CODING_STYLE +7
-0@@ -116,3 +116,10 @@ if (a == 1) { Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this.
Quoted 15 lines · Peter Maydell
Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in
CODING_STYLE.Suggested-by Thomas Huth <[email protected]>Signed-off-by Peter Maydell <[email protected]>--- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+)CODING_STYLE +0
-0
CODING_STYLE if (a == 1) { · line 125
Quoted 10 lines
CODING_STYLE +7
-0@@ -116,3 +116,10 @@ if (a == 1) { Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this.
Quoted 16 lines · Peter Maydell
Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in
CODING_STYLE.Suggested-by Thomas Huth <[email protected]>Signed-off-by Peter Maydell <[email protected]>--- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+)CODING_STYLE +0
-0
CODING_STYLE if (a == 1) { · line 125
Quoted 10 lines
CODING_STYLE +7
-0@@ -116,3 +116,10 @@ if (a == 1) { Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this.
Quoted 9 lines · Peter Maydell
Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in
CODING_STYLE.Suggested-by Thomas Huth <[email protected]>Signed-off-by Peter Maydell <[email protected]>--- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+)
Michael Tokarev
AppliedQuoted 3 lines · Peter Maydell
Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in
CODING_STYLE.
Applied to -trivial, thanks!
/mjt