From: chaihaoyu <chaihaoyu1@huawei.com>
To: <qemu-devel@nongnu.org>, <pbonzini@redhat.com>,
Peter Xu <peterx@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: alex.chen@huawei.com, hunongda@huawei.com
Subject: [PATCH v2 1/5] softmmu: fix problems about spaces
Date: Fri, 15 Jan 2021 11:55:35 +0800 [thread overview]
Message-ID: <4f1ef805-d1de-26e7-d0b6-3f443a1f7c4a@huawei.com> (raw)
In-Reply-To: <aaa530f5-b7ec-3198-a80b-efb88de20c6c@huawei.com>
This patch fixes error messages found by checkpatch.pl:
fix problems about spaces:
Signed-off-by: Haoyu Chai <chaihaoyu1@huawei.com>
---
softmmu/bootdevice.c | 4 ++--
softmmu/memory.c | 16 ++++++++--------
softmmu/qdev-monitor.c | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/softmmu/bootdevice.c b/softmmu/bootdevice.c
index add4e3d2d1..4edb80de8c 100644
--- a/softmmu/bootdevice.c
+++ b/softmmu/bootdevice.c
@@ -257,7 +257,7 @@ char *get_boot_devices_list(size_t *size)
bootpath = get_boot_device_path(i->dev, ignore_suffixes, i->suffix);
if (total) {
- list[total-1] = '\n';
+ list[total - 1] = '\n';
}
len = strlen(bootpath) + 1;
list = g_realloc(list, total + len);
@@ -269,7 +269,7 @@ char *get_boot_devices_list(size_t *size)
*size = total;
if (boot_strict && *size > 0) {
- list[total-1] = '\n';
+ list[total - 1] = '\n';
list = g_realloc(list, total + 5);
memcpy(&list[total], "HALT", 5);
*size = total + 5;
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 333e1ed7b0..2d346b9de4 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -336,7 +336,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;
}
@@ -841,8 +841,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;
}
}
}
@@ -2371,8 +2371,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();
@@ -2404,11 +2404,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();
}
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 8dc656becc..a681d6a4e8 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -501,7 +501,7 @@ static BusState *qbus_find(const char *path, Error **errp)
}
/* find device */
- if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
+ if (sscanf(path + pos, "%127[^/]%n", elem, &len) != 1) {
g_assert_not_reached();
elem[0] = len = 0;
}
@@ -536,7 +536,7 @@ static BusState *qbus_find(const char *path, Error **errp)
}
/* find bus */
- if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
+ if (sscanf(path + pos, "%127[^/]%n", elem, &len) != 1) {
g_assert_not_reached();
elem[0] = len = 0;
}
--
2.29.1.59.gf9b6481aed
next prev parent reply other threads:[~2021-01-15 3:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 3:52 [PATCH v2 0/5] softmmu: some space-style problems while coding chaihaoyu
2021-01-15 3:55 ` chaihaoyu [this message]
2021-01-15 3:56 ` [PATCH v2 2/5] softmmu: braces {} are needed for if statement chaihaoyu
2021-01-15 3:57 ` [PATCH v2 3/5] softmmu: don't use '#' flag of printf format ('%#') in format strings chaihaoyu
2021-01-15 3:57 ` [PATCH v2 4/5] softmmu: "foo* bar" should be "foo *bar" chaihaoyu
2021-01-15 3:58 ` [PATCH v2 5/5] softmmu: code indent should never use tabs 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=4f1ef805-d1de-26e7-d0b6-3f443a1f7c4a@huawei.com \
--to=chaihaoyu1@huawei.com \
--cc=alex.chen@huawei.com \
--cc=hunongda@huawei.com \
--cc=pbonzini@redhat.com \
--cc=peterx@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).