qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: chaihaoyu <chaihaoyu1@huawei.com>
To: <pbonzini@redhat.com>
Cc: alex.chen@huawei.com, hunongda@huawei.com, qemu-devel@nongnu.org
Subject: [PATCH] spaces are required in some places
Date: Thu, 29 Oct 2020 22:25:42 +0800	[thread overview]
Message-ID: <34e5417e-f81d-e399-ae2c-0f27467a5f43@huawei.com> (raw)

Date: Thu, 29 Oct 2020 22:01:33 +0800
signed-off-by: Haoyu Chai<chaihaoyu1@huawei.com>
Reported-by: Euler Robot <euler.robot@huawei.com>

While reading softmmu related code, I found some style problems. Some spaces are required in softmmu/memory.c
---
 softmmu/memory.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index ee4a6bc168..550cffe8f6 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -158,7 +158,7 @@ enum ListenerDirection { Forward, Reverse };
         MemoryRegionSection mrs = section_from_flat_range(fr,           \
                 address_space_to_flatview(as));                         \
         MEMORY_LISTENER_CALL(as, callback, dir, &mrs, ##_args);         \
-    } while(0)
+    } while (0)

 struct CoalescedMemoryRange {
     AddrRange addr;
@@ -329,7 +329,7 @@ static void flatview_simplify(FlatView *view)
     while (i < view->nr) {
         j = i + 1;
         while (j < view->nr
-               && can_merge(&view->ranges[j-1], &view->ranges[j])) {
+               && can_merge(&view->ranges[j - 1], &view->ranges[j])) {
             int128_addto(&view->ranges[i].addr.size, view->ranges[j].addr.size);
             ++j;
         }
@@ -834,8 +834,8 @@ static void address_space_update_ioeventfds(AddressSpace *as)
                     ioeventfds = g_realloc(ioeventfds,
                             ioeventfd_max * sizeof(*ioeventfds));
                 }
-                ioeventfds[ioeventfd_nb-1] = fr->mr->ioeventfds[i];
-                ioeventfds[ioeventfd_nb-1].addr = tmp;
+                ioeventfds[ioeventfd_nb - 1] = fr->mr->ioeventfds[i];
+                ioeventfds[ioeventfd_nb - 1].addr = tmp;
             }
         }
     }
@@ -2343,8 +2343,8 @@ void memory_region_add_eventfd(MemoryRegion *mr,
     ++mr->ioeventfd_nb;
     mr->ioeventfds = g_realloc(mr->ioeventfds,
                                   sizeof(*mr->ioeventfds) * mr->ioeventfd_nb);
-    memmove(&mr->ioeventfds[i+1], &mr->ioeventfds[i],
-            sizeof(*mr->ioeventfds) * (mr->ioeventfd_nb-1 - i));
+    memmove(&mr->ioeventfds[i + 1], &mr->ioeventfds[i],
+            sizeof(*mr->ioeventfds) * (mr->ioeventfd_nb - 1 - i));
     mr->ioeventfds[i] = mrfd;
     ioeventfd_update_pending |= mr->enabled;
     memory_region_transaction_commit();
@@ -2376,11 +2376,11 @@ void memory_region_del_eventfd(MemoryRegion *mr,
         }
     }
     assert(i != mr->ioeventfd_nb);
-    memmove(&mr->ioeventfds[i], &mr->ioeventfds[i+1],
-            sizeof(*mr->ioeventfds) * (mr->ioeventfd_nb - (i+1)));
+    memmove(&mr->ioeventfds[i], &mr->ioeventfds[i + 1],
+            sizeof(*mr->ioeventfds) * (mr->ioeventfd_nb - (i + 1)));
     --mr->ioeventfd_nb;
     mr->ioeventfds = g_realloc(mr->ioeventfds,
-                                  sizeof(*mr->ioeventfds)*mr->ioeventfd_nb + 1);
+                                  sizeof(*mr->ioeventfds) * mr->ioeventfd_nb + 1);
     ioeventfd_update_pending |= mr->enabled;
     memory_region_transaction_commit();
 }
-- 


             reply	other threads:[~2020-10-29 14:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 14:25 chaihaoyu [this message]
2020-10-29 15:04 ` [PATCH] spaces are required in some places 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

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=34e5417e-f81d-e399-ae2c-0f27467a5f43@huawei.com \
    --to=chaihaoyu1@huawei.com \
    --cc=alex.chen@huawei.com \
    --cc=hunongda@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).