qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: chaihaoyu <chaihaoyu1@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: alex.chen@huawei.com, pbonzini@redhat.com,
	zhang.zhanghailiang@huawei.com, qemu-devel@nongnu.org,
	hunongda@huawei.com
Subject: Re: [PATCH v2 1/3] softmmu: Do not use C99 // comments
Date: Wed, 4 Nov 2020 15:49:38 +0800	[thread overview]
Message-ID: <b062f265-db59-5ca9-7479-3ab7718180cd@huawei.com> (raw)
In-Reply-To: <87zh3zot3x.fsf@dusky.pond.sub.org>


Thank you for your replay. That's OK if C99 support both kinds of comment style.

————————————————————————————————————————————————
> chaihaoyu <chaihaoyu1@huawei.com> writes:
> 
>> Hi, recently I found some code style problems while using checkpatch.pl tool,please review.
>>
>> Date: Tue, 3 Nov 2020 11:01:40 +0800
>> signed-off-by: Haoyu Chai<chaihaoyu1@huawei.com>
>> ---
>>  softmmu/memory.c         | 2 +-
>>  softmmu/memory_mapping.c | 2 +-
>>  softmmu/physmem.c        | 2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/softmmu/memory.c b/softmmu/memory.c
>> index 107ce0a4f8..5fb591b001 100644
>> --- a/softmmu/memory.c
>> +++ b/softmmu/memory.c
>> @@ -36,7 +36,7 @@
>>  #include "hw/boards.h"
>>  #include "migration/vmstate.h"
>>
>> -//#define DEBUG_UNASSIGNED
>> +/* #define DEBUG_UNASSIGNED */
>>
>>  static unsigned memory_region_transaction_depth;
>>  static bool memory_region_update_pending;
>> diff --git a/softmmu/memory_mapping.c b/softmmu/memory_mapping.c
>> index 18d0b8067c..f64053499e 100644
>> --- a/softmmu/memory_mapping.c
>> +++ b/softmmu/memory_mapping.c
>> @@ -19,7 +19,7 @@
>>  #include "exec/memory.h"
>>  #include "exec/address-spaces.h"
>>
>> -//#define DEBUG_GUEST_PHYS_REGION_ADD
>> +/* #define DEBUG_GUEST_PHYS_REGION_ADD */
>>
>>  static void memory_mapping_list_add_mapping_sorted(MemoryMappingList *list,
>>                                                     MemoryMapping *mapping)
>> diff --git a/softmmu/physmem.c b/softmmu/physmem.c
>> index 44ffb60b5d..78c1b6580a 100644
>> --- a/softmmu/physmem.c
>> +++ b/softmmu/physmem.c
>> @@ -75,7 +75,7 @@
>>  #include <daxctl/libdaxctl.h>
>>  #endif
>>
>> -//#define DEBUG_SUBPAGE
>> +/* #define DEBUG_SUBPAGE */
>>
>>  /* ram_list is read under rcu_read_lock()/rcu_read_unlock().  Writes
>>   * are protected by the ramlist lock.
> 
> I recommend to leave these alone.
> 
> CODING_STYLE.rst:
> 
>     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.
> 
> For "real" comments, we overwhelmingly use /* */, and avoiding // makes
> sense.  Most exceptions are in code we copy from elsewhere, such as
> disas/libvixl/.
> 
> For commenting out *code*, we use both forms.  Here are the counts for
> commenting out macro definitions:
> 
>     $ git-grep '^/\* *# *define' | wc -l
>     125
>     $ git-grep '^// *# *define' | wc -l
>     192
> 
> .
> 


      reply	other threads:[~2020-11-04  7:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 14:25 [PATCH] spaces are required in some places chaihaoyu
2020-10-29 15:04 ` no-reply
2020-11-03  4:06   ` [PATCH v2 1/3] softmmu: Do not use C99 // comments chaihaoyu
2020-11-03  4:09     ` [PATCH v2 2/3] softmmu: Don't use '#' flag of printf format chaihaoyu
2020-11-03  4:12     ` [PATCH v2 3/3] softmmu: braces {} are necessary for all arms of this statement chaihaoyu
2020-11-03  4:16     ` [PATCH v2 0/3] softmmu: some space-style problems while coding chaihaoyu
2020-11-03  6:24     ` [PATCH v2 1/3] softmmu: Do not use C99 // comments Markus Armbruster
2020-11-04  7:49       ` chaihaoyu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b062f265-db59-5ca9-7479-3ab7718180cd@huawei.com \
    --to=chaihaoyu1@huawei.com \
    --cc=alex.chen@huawei.com \
    --cc=armbru@redhat.com \
    --cc=hunongda@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).