All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form
@ 2017-02-03 17:58 Peter Maydell
  2017-02-04 10:00 ` Markus Armbruster
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Peter Maydell @ 2017-02-03 17:58 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: patches, Thomas Huth

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 <thuth@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 CODING_STYLE | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CODING_STYLE b/CODING_STYLE
index f53180b..2fa0c0b 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -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.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form
  2017-02-03 17:58 [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
@ 2017-02-04 10:00 ` Markus Armbruster
  2017-02-04 14:48 ` Fam Zheng
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Markus Armbruster @ 2017-02-04 10:00 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, qemu-trivial, Thomas Huth, patches

Peter Maydell <peter.maydell@linaro.org> writes:

> 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 <thuth@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  CODING_STYLE | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/CODING_STYLE b/CODING_STYLE
> index f53180b..2fa0c0b 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -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.

Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form
  2017-02-03 17:58 [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
  2017-02-04 10:00 ` Markus Armbruster
@ 2017-02-04 14:48 ` Fam Zheng
  2017-02-05 18:02 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Fam Zheng @ 2017-02-04 14:48 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, qemu-trivial, Thomas Huth, patches

On Fri, 02/03 17:58, Peter Maydell wrote:
> 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 <thuth@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  CODING_STYLE | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/CODING_STYLE b/CODING_STYLE
> index f53180b..2fa0c0b 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -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.

Reviewed-by: Fam Zheng <famz@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] CODING_STYLE: Mention preferred comment form
  2017-02-03 17:58 [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
  2017-02-04 10:00 ` Markus Armbruster
  2017-02-04 14:48 ` Fam Zheng
@ 2017-02-05 18:02 ` Laurent Vivier
  2017-02-13 14:00 ` [Qemu-devel] " Stefan Hajnoczi
  2017-02-15 10:17 ` Michael Tokarev
  4 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2017-02-05 18:02 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel, qemu-trivial; +Cc: Thomas Huth, patches

Le 03/02/2017 à 18:58, Peter Maydell a écrit :
> 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 <thuth@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  CODING_STYLE | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/CODING_STYLE b/CODING_STYLE
> index f53180b..2fa0c0b 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -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.
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form
  2017-02-03 17:58 [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
                   ` (2 preceding siblings ...)
  2017-02-05 18:02 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
@ 2017-02-13 14:00 ` Stefan Hajnoczi
  2017-02-15 10:17 ` Michael Tokarev
  4 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2017-02-13 14:00 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, qemu-trivial, Thomas Huth, patches

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

On Fri, Feb 03, 2017 at 05:58:42PM +0000, Peter Maydell wrote:
> 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 <thuth@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  CODING_STYLE | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form
  2017-02-03 17:58 [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
                   ` (3 preceding siblings ...)
  2017-02-13 14:00 ` [Qemu-devel] " Stefan Hajnoczi
@ 2017-02-15 10:17 ` Michael Tokarev
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Tokarev @ 2017-02-15 10:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel, qemu-trivial; +Cc: Thomas Huth, patches

03.02.2017 20:58, Peter Maydell wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-15 10:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03 17:58 [Qemu-devel] [PATCH] CODING_STYLE: Mention preferred comment form Peter Maydell
2017-02-04 10:00 ` Markus Armbruster
2017-02-04 14:48 ` Fam Zheng
2017-02-05 18:02 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2017-02-13 14:00 ` [Qemu-devel] " Stefan Hajnoczi
2017-02-15 10:17 ` Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.