* [PATCH v3 0/5] Fix some style problems in contrib
@ 2021-01-18 3:09 zhouyang
2021-01-18 3:10 ` [PATCH v3 1/5] contrib: Don't use '#' flag of printf format zhouyang
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: zhouyang @ 2021-01-18 3:09 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel, zhouyang789
v3 -> v2
add Cc
zhouyang (5):
contrib: Don't use '#' flag of printf format
contrib: Fix some code style problems, ERROR: "foo * bar" should be
"foo *bar"
contrib: Add spaces around operator
contrib: space required after that ','
contrib: Open brace '{' following struct go on the same line
contrib/ivshmem-server/main.c | 2 +-
contrib/plugins/hotblocks.c | 2 +-
contrib/plugins/hotpages.c | 2 +-
contrib/plugins/howvec.c | 19 +++++++++----------
contrib/plugins/lockstep.c | 6 +++---
5 files changed, 15 insertions(+), 16 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/5] contrib: Don't use '#' flag of printf format
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
@ 2021-01-18 3:10 ` zhouyang
2021-01-18 3:10 ` [PATCH v3 2/5] contrib: Fix some code style problems, ERROR: "foo * bar" should be "foo *bar" zhouyang
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: zhouyang @ 2021-01-18 3:10 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel, zhouyang789
I am reading contrib related code and found some style problems while
check the code using checkpatch.pl. This commit fixs the misuse of
'#' flag of printf format
Signed-off-by: zhouyang <zhouyang789@huawei.com>
---
contrib/plugins/hotblocks.c | 2 +-
contrib/plugins/hotpages.c | 2 +-
contrib/plugins/howvec.c | 2 +-
contrib/plugins/lockstep.c | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c
index 37435a3fc7..4b08340143 100644
--- a/contrib/plugins/hotblocks.c
+++ b/contrib/plugins/hotblocks.c
@@ -63,7 +63,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
for (i = 0; i < limit && it->next; i++, it = it->next) {
ExecCount *rec = (ExecCount *) it->data;
- g_string_append_printf(report, "%#016"PRIx64", %d, %ld, %"PRId64"\n",
+ g_string_append_printf(report, "0x%016"PRIx64", %d, %ld, %"PRId64"\n",
rec->start_addr, rec->trans_count,
rec->insns, rec->exec_count);
}
diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c
index ecd6c18732..eacc678eac 100644
--- a/contrib/plugins/hotpages.c
+++ b/contrib/plugins/hotpages.c
@@ -88,7 +88,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
for (i = 0; i < limit && it->next; i++, it = it->next) {
PageCounters *rec = (PageCounters *) it->data;
g_string_append_printf(report,
- "%#016"PRIx64", 0x%04x, %"PRId64
+ "0x%016"PRIx64", 0x%04x, %"PRId64
", 0x%04x, %"PRId64"\n",
rec->page_address,
rec->cpu_read, rec->reads,
diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 3b9a6939f2..6e602aaccf 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -209,7 +209,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
i++, counts = g_list_next(counts)) {
InsnExecCount *rec = (InsnExecCount *) counts->data;
g_string_append_printf(report,
- "Instr: %-24s\t(%ld hits)\t(op=%#08x/%s)\n",
+ "Instr: %-24s\t(%ld hits)\t(op=0x%08x/%s)\n",
rec->insn,
rec->count,
rec->opcode,
diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
index 5aad50869d..7fd35eb669 100644
--- a/contrib/plugins/lockstep.c
+++ b/contrib/plugins/lockstep.c
@@ -134,7 +134,7 @@ static void report_divergance(ExecState *us, ExecState *them)
/* Output short log entry of going out of sync... */
if (verbose || divrec.distance == 1 || diverged) {
- g_string_printf(out, "@ %#016lx vs %#016lx (%d/%d since last)\n",
+ g_string_printf(out, "@ 0x%016lx vs 0x%016lx (%d/%d since last)\n",
us->pc, them->pc, g_slist_length(divergence_log),
divrec.distance);
qemu_plugin_outs(out->str);
@@ -144,7 +144,7 @@ static void report_divergance(ExecState *us, ExecState *them)
int i;
GSList *entry;
- g_string_printf(out, "Δ insn_count @ %#016lx (%ld) vs %#016lx (%ld)\n",
+ g_string_printf(out, "Δ insn_count @ 0x%016lx (%ld) vs 0x%016lx (%ld)\n",
us->pc, us->insn_count, them->pc, them->insn_count);
for (entry = log, i = 0;
@@ -152,7 +152,7 @@ static void report_divergance(ExecState *us, ExecState *them)
entry = g_slist_next(entry), i++) {
ExecInfo *prev = (ExecInfo *) entry->data;
g_string_append_printf(out,
- " previously @ %#016lx/%ld (%ld insns)\n",
+ " previously @ 0x%016lx/%ld (%ld insns)\n",
prev->block->pc, prev->block->insns,
prev->insn_count);
}
--
2.23.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/5] contrib: Fix some code style problems, ERROR: "foo * bar" should be "foo *bar"
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
2021-01-18 3:10 ` [PATCH v3 1/5] contrib: Don't use '#' flag of printf format zhouyang
@ 2021-01-18 3:10 ` zhouyang
2021-01-18 3:10 ` [PATCH v3 3/5] contrib: Add spaces around operator zhouyang
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: zhouyang @ 2021-01-18 3:10 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel, zhouyang789
I am reading contrib related code and found some style problems while
check the code using checkpatch.pl. This commit fixs the issue below:
ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: zhouyang <zhouyang789@huawei.com>
---
contrib/plugins/howvec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 6e602aaccf..2f892da17d 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -235,7 +235,7 @@ static void vcpu_insn_exec_before(unsigned int cpu_index, void *udata)
(*count)++;
}
-static uint64_t * find_counter(struct qemu_plugin_insn *insn)
+static uint64_t *find_counter(struct qemu_plugin_insn *insn)
{
int i;
uint64_t *cnt = NULL;
--
2.23.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/5] contrib: Add spaces around operator
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
2021-01-18 3:10 ` [PATCH v3 1/5] contrib: Don't use '#' flag of printf format zhouyang
2021-01-18 3:10 ` [PATCH v3 2/5] contrib: Fix some code style problems, ERROR: "foo * bar" should be "foo *bar" zhouyang
@ 2021-01-18 3:10 ` zhouyang
2021-01-18 3:10 ` [PATCH v3 4/5] contrib: space required after that ',' zhouyang
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: zhouyang @ 2021-01-18 3:10 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel, zhouyang789
I am reading contrib related code and found some style problems while
check the code using checkpatch.pl. This commit fixs the issue below:
ERROR: spaces required around that '*'
Signed-off-by: zhouyang <zhouyang789@huawei.com>
---
contrib/ivshmem-server/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index ee08c4ced0..224dbeb547 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -17,7 +17,7 @@
#define IVSHMEM_SERVER_DEFAULT_PID_FILE "/var/run/ivshmem-server.pid"
#define IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH "/tmp/ivshmem_socket"
#define IVSHMEM_SERVER_DEFAULT_SHM_PATH "ivshmem"
-#define IVSHMEM_SERVER_DEFAULT_SHM_SIZE (4*1024*1024)
+#define IVSHMEM_SERVER_DEFAULT_SHM_SIZE (4 * 1024 * 1024)
#define IVSHMEM_SERVER_DEFAULT_N_VECTORS 1
/* used to quit on signal SIGTERM */
--
2.23.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 4/5] contrib: space required after that ','
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
` (2 preceding siblings ...)
2021-01-18 3:10 ` [PATCH v3 3/5] contrib: Add spaces around operator zhouyang
@ 2021-01-18 3:10 ` zhouyang
2021-01-18 3:10 ` [PATCH v3 5/5] contrib: Open brace '{' following struct go on the same line zhouyang
2021-02-01 12:42 ` [PATCH v3 0/5] Fix some style problems in contrib zhouyang (T)
5 siblings, 0 replies; 8+ messages in thread
From: zhouyang @ 2021-01-18 3:10 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel, zhouyang789
I am reading contrib related code and found some style problems while
check the code using checkpatch.pl. This commit fixs the issue below:
ERROR: space required after that ','
Signed-off-by: zhouyang <zhouyang789@huawei.com>
---
contrib/plugins/howvec.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 2f892da17d..9d6fa33297 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -68,7 +68,7 @@ static InsnClassExecCount aarch64_insn_classes[] = {
{ "Reserved", "res", 0x1e000000, 0x00000000, COUNT_CLASS},
/* Data Processing Immediate */
{ " PCrel addr", "pcrel", 0x1f000000, 0x10000000, COUNT_CLASS},
- { " Add/Sub (imm,tags)","asit", 0x1f800000, 0x11800000, COUNT_CLASS},
+ { " Add/Sub (imm,tags)", "asit", 0x1f800000, 0x11800000, COUNT_CLASS},
{ " Add/Sub (imm)", "asi", 0x1f000000, 0x11000000, COUNT_CLASS},
{ " Logical (imm)", "logi", 0x1f800000, 0x12000000, COUNT_CLASS},
{ " Move Wide (imm)", "movwi", 0x1f800000, 0x12800000, COUNT_CLASS},
@@ -91,17 +91,17 @@ static InsnClassExecCount aarch64_insn_classes[] = {
{ "Branches", "branch", 0x1c000000, 0x14000000, COUNT_CLASS},
/* Loads and Stores */
{ " AdvSimd ldstmult", "advlsm", 0xbfbf0000, 0x0c000000, COUNT_CLASS},
- { " AdvSimd ldstmult++","advlsmp",0xbfb00000, 0x0c800000, COUNT_CLASS},
+ { " AdvSimd ldstmult++", "advlsmp", 0xbfb00000, 0x0c800000, COUNT_CLASS},
{ " AdvSimd ldst", "advlss", 0xbf9f0000, 0x0d000000, COUNT_CLASS},
- { " AdvSimd ldst++", "advlssp",0xbf800000, 0x0d800000, COUNT_CLASS},
+ { " AdvSimd ldst++", "advlssp", 0xbf800000, 0x0d800000, COUNT_CLASS},
{ " ldst excl", "ldstx", 0x3f000000, 0x08000000, COUNT_CLASS},
{ " Prefetch", "prfm", 0xff000000, 0xd8000000, COUNT_CLASS},
{ " Load Reg (lit)", "ldlit", 0x1b000000, 0x18000000, COUNT_CLASS},
- { " ldst noalloc pair", "ldstnap",0x3b800000, 0x28000000, COUNT_CLASS},
+ { " ldst noalloc pair", "ldstnap", 0x3b800000, 0x28000000, COUNT_CLASS},
{ " ldst pair", "ldstp", 0x38000000, 0x28000000, COUNT_CLASS},
{ " ldst reg", "ldstr", 0x3b200000, 0x38000000, COUNT_CLASS},
{ " Atomic ldst", "atomic", 0x3b200c00, 0x38200000, COUNT_CLASS},
- { " ldst reg (reg off)","ldstro", 0x3b200b00, 0x38200800, COUNT_CLASS},
+ { " ldst reg (reg off)", "ldstro", 0x3b200b00, 0x38200800, COUNT_CLASS},
{ " ldst reg (pac)", "ldstpa", 0x3b200200, 0x38200800, COUNT_CLASS},
{ " ldst reg (imm)", "ldsti", 0x3b000000, 0x39000000, COUNT_CLASS},
{ "Loads & Stores", "ldst", 0x0a000000, 0x08000000, COUNT_CLASS},
@@ -202,7 +202,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
counts = g_hash_table_get_values(insns);
if (counts && g_list_next(counts)) {
- g_string_append_printf(report,"Individual Instructions:\n");
+ g_string_append_printf(report, "Individual Instructions:\n");
counts = g_list_sort(counts, cmp_exec_count);
for (i = 0; i < limit && g_list_next(counts);
--
2.23.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 5/5] contrib: Open brace '{' following struct go on the same line
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
` (3 preceding siblings ...)
2021-01-18 3:10 ` [PATCH v3 4/5] contrib: space required after that ',' zhouyang
@ 2021-01-18 3:10 ` zhouyang
2021-02-01 12:42 ` [PATCH v3 0/5] Fix some style problems in contrib zhouyang (T)
5 siblings, 0 replies; 8+ messages in thread
From: zhouyang @ 2021-01-18 3:10 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel, zhouyang789
I found some style problems whil check the code using checkpatch.pl.
This commit fixs the issue below:
ERROR: that open brace { should be on the previous line
Signed-off-by: zhouyang <zhouyang789@huawei.com>
---
contrib/plugins/howvec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 9d6fa33297..600f7facc1 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -145,8 +145,7 @@ typedef struct {
int table_sz;
} ClassSelector;
-static ClassSelector class_tables[] =
-{
+static ClassSelector class_tables[] = {
{ "aarch64", aarch64_insn_classes, ARRAY_SIZE(aarch64_insn_classes) },
{ "sparc", sparc32_insn_classes, ARRAY_SIZE(sparc32_insn_classes) },
{ "sparc64", sparc64_insn_classes, ARRAY_SIZE(sparc64_insn_classes) },
--
2.23.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/5] Fix some style problems in contrib
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
` (4 preceding siblings ...)
2021-01-18 3:10 ` [PATCH v3 5/5] contrib: Open brace '{' following struct go on the same line zhouyang
@ 2021-02-01 12:42 ` zhouyang (T)
2021-02-02 14:40 ` Alex Bennée
5 siblings, 1 reply; 8+ messages in thread
From: zhouyang (T) @ 2021-02-01 12:42 UTC (permalink / raw)
To: alex.bennee; +Cc: alex.chen, qemu-devel
kindly ping,
the link of this patch set is:http://patchwork.ozlabs.org/project/qemu-devel/cover/20210118031004.1662363-1-zhouyang789@huawei.com/
On 2021/1/18 11:09, zhouyang wrote:
> v3 -> v2
> add Cc
>
> zhouyang (5):
> contrib: Don't use '#' flag of printf format
> contrib: Fix some code style problems, ERROR: "foo * bar" should be
> "foo *bar"
> contrib: Add spaces around operator
> contrib: space required after that ','
> contrib: Open brace '{' following struct go on the same line
>
> contrib/ivshmem-server/main.c | 2 +-
> contrib/plugins/hotblocks.c | 2 +-
> contrib/plugins/hotpages.c | 2 +-
> contrib/plugins/howvec.c | 19 +++++++++----------
> contrib/plugins/lockstep.c | 6 +++---
> 5 files changed, 15 insertions(+), 16 deletions(-)
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/5] Fix some style problems in contrib
2021-02-01 12:42 ` [PATCH v3 0/5] Fix some style problems in contrib zhouyang (T)
@ 2021-02-02 14:40 ` Alex Bennée
0 siblings, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2021-02-02 14:40 UTC (permalink / raw)
To: zhouyang (T); +Cc: alex.chen, qemu-devel
zhouyang (T) <zhouyang789@huawei.com> writes:
> kindly ping,
> the link of this patch set
> is:http://patchwork.ozlabs.org/project/qemu-devel/cover/20210118031004.1662363-1-zhouyang789@huawei.com/
Queued to plugins/next, thanks.
(I might as well pick-up the ivshmem-server change while I'm at it as
it's trivial).
>
>
> On 2021/1/18 11:09, zhouyang wrote:
>> v3 -> v2
>> add Cc
>>
>> zhouyang (5):
>> contrib: Don't use '#' flag of printf format
>> contrib: Fix some code style problems, ERROR: "foo * bar" should be
>> "foo *bar"
>> contrib: Add spaces around operator
>> contrib: space required after that ','
>> contrib: Open brace '{' following struct go on the same line
>>
>> contrib/ivshmem-server/main.c | 2 +-
>> contrib/plugins/hotblocks.c | 2 +-
>> contrib/plugins/hotpages.c | 2 +-
>> contrib/plugins/howvec.c | 19 +++++++++----------
>> contrib/plugins/lockstep.c | 6 +++---
>> 5 files changed, 15 insertions(+), 16 deletions(-)
>>
--
Alex Bennée
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-02-02 14:59 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 3:09 [PATCH v3 0/5] Fix some style problems in contrib zhouyang
2021-01-18 3:10 ` [PATCH v3 1/5] contrib: Don't use '#' flag of printf format zhouyang
2021-01-18 3:10 ` [PATCH v3 2/5] contrib: Fix some code style problems, ERROR: "foo * bar" should be "foo *bar" zhouyang
2021-01-18 3:10 ` [PATCH v3 3/5] contrib: Add spaces around operator zhouyang
2021-01-18 3:10 ` [PATCH v3 4/5] contrib: space required after that ',' zhouyang
2021-01-18 3:10 ` [PATCH v3 5/5] contrib: Open brace '{' following struct go on the same line zhouyang
2021-02-01 12:42 ` [PATCH v3 0/5] Fix some style problems in contrib zhouyang (T)
2021-02-02 14:40 ` Alex Bennée
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.