qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] target/arm: add spaces around operator
@ 2020-11-03 11:45 Xinhao Zhang
  2020-11-03 11:45 ` [PATCH 2/3] target/arm: Don't use '#' flag of printf format Xinhao Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xinhao Zhang @ 2020-11-03 11:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.chen, peter.maydell, qemu-arm, qemu-trivial, dengkai1

Fix code style. Operator needs spaces both sides.

Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
---
 target/arm/arch_dump.c | 8 ++++----
 target/arm/arm-semi.c  | 8 ++++----
 target/arm/helper.c    | 2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c
index 7693e17e96..0184845310 100644
--- a/target/arm/arch_dump.c
+++ b/target/arm/arch_dump.c
@@ -114,8 +114,8 @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,
 
     for (i = 0; i < 32; ++i) {
         uint64_t *q = aa64_vfp_qreg(env, i);
-        note.vfp.vregs[2*i + 0] = cpu_to_dump64(s, q[0]);
-        note.vfp.vregs[2*i + 1] = cpu_to_dump64(s, q[1]);
+        note.vfp.vregs[2 * i + 0] = cpu_to_dump64(s, q[0]);
+        note.vfp.vregs[2 * i + 1] = cpu_to_dump64(s, q[1]);
     }
 
     if (s->dump_info.d_endian == ELFDATA2MSB) {
@@ -125,8 +125,8 @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,
          */
         for (i = 0; i < 32; ++i) {
             uint64_t tmp = note.vfp.vregs[2*i];
-            note.vfp.vregs[2*i] = note.vfp.vregs[2*i+1];
-            note.vfp.vregs[2*i+1] = tmp;
+            note.vfp.vregs[2 * i] = note.vfp.vregs[2 * i + 1];
+            note.vfp.vregs[2 * i + 1] = tmp;
         }
     }
 
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c
index 8718fd0194..c1df664f7e 100644
--- a/target/arm/arm-semi.c
+++ b/target/arm/arm-semi.c
@@ -755,7 +755,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)
         if (use_gdb_syscalls()) {
             arm_semi_open_guestfd = guestfd;
             ret = arm_gdb_syscall(cpu, arm_semi_open_cb, "open,%s,%x,1a4", arg0,
-                                  (int)arg2+1, gdb_open_modeflags[arg1]);
+                                  (int)arg2 + 1, gdb_open_modeflags[arg1]);
         } else {
             ret = set_swi_errno(env, open(s, open_modeflags[arg1], 0644));
             if (ret == (uint32_t)-1) {
@@ -852,7 +852,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)
         GET_ARG(1);
         if (use_gdb_syscalls()) {
             ret = arm_gdb_syscall(cpu, arm_semi_cb, "unlink,%s",
-                                  arg0, (int)arg1+1);
+                                  arg0, (int)arg1 + 1);
         } else {
             s = lock_user_string(arg0);
             if (!s) {
@@ -870,7 +870,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)
         GET_ARG(3);
         if (use_gdb_syscalls()) {
             return arm_gdb_syscall(cpu, arm_semi_cb, "rename,%s,%s",
-                                   arg0, (int)arg1+1, arg2, (int)arg3+1);
+                                   arg0, (int)arg1 + 1, arg2, (int)arg3 + 1);
         } else {
             char *s2;
             s = lock_user_string(arg0);
@@ -896,7 +896,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)
         GET_ARG(1);
         if (use_gdb_syscalls()) {
             return arm_gdb_syscall(cpu, arm_semi_cb, "system,%s",
-                                   arg0, (int)arg1+1);
+                                   arg0, (int)arg1 + 1);
         } else {
             s = lock_user_string(arg0);
             if (!s) {
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 97bb6b8c01..4586e33014 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -12518,7 +12518,7 @@ uint32_t HELPER(usad8)(uint32_t a, uint32_t b)
     uint32_t sum;
     sum = do_usad(a, b);
     sum += do_usad(a >> 8, b >> 8);
-    sum += do_usad(a >> 16, b >>16);
+    sum += do_usad(a >> 16, b >> 16);
     sum += do_usad(a >> 24, b >> 24);
     return sum;
 }
-- 
2.29.0-rc1



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

* [PATCH 2/3] target/arm: Don't use '#' flag of printf format
  2020-11-03 11:45 [PATCH 1/3] target/arm: add spaces around operator Xinhao Zhang
@ 2020-11-03 11:45 ` Xinhao Zhang
  2020-11-03 11:45 ` [PATCH 3/3] target/arm: add space before the open parenthesis '(' Xinhao Zhang
  2020-11-04 18:04 ` [PATCH 1/3] target/arm: add spaces around operator Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Xinhao Zhang @ 2020-11-03 11:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.chen, peter.maydell, qemu-arm, qemu-trivial, dengkai1

Fix code style. Don't use '#' flag of printf format ('%#') in
format strings, use '0x' prefix instead

Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
---
 target/arm/translate-a64.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 072754fa24..1867ec293f 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -12114,7 +12114,7 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
                 gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst);
                 break;
             default:
-                fprintf(stderr, "%s: insn %#04x, fpop %#2x @ %#" PRIx64 "\n",
+                fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n",
                         __func__, insn, fpopcode, s->pc_curr);
                 g_assert_not_reached();
             }
@@ -13121,7 +13121,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)
     case 0x7f: /* FSQRT (vector) */
         break;
     default:
-        fprintf(stderr, "%s: insn %#04x fpop %#2x\n", __func__, insn, fpop);
+        fprintf(stderr, "%s: insn 0x%04x fpop 0x%2x\n", __func__, insn, fpop);
         g_assert_not_reached();
     }
 
-- 
2.29.0-rc1



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

* [PATCH 3/3] target/arm: add space before the open parenthesis '('
  2020-11-03 11:45 [PATCH 1/3] target/arm: add spaces around operator Xinhao Zhang
  2020-11-03 11:45 ` [PATCH 2/3] target/arm: Don't use '#' flag of printf format Xinhao Zhang
@ 2020-11-03 11:45 ` Xinhao Zhang
  2020-11-04 18:04 ` [PATCH 1/3] target/arm: add spaces around operator Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Xinhao Zhang @ 2020-11-03 11:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.chen, peter.maydell, qemu-arm, qemu-trivial, dengkai1

Fix code style. Space required before the open parenthesis '('.

Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
Signed-off-by: Kai Deng <dengkai1@huawei.com>
---
 target/arm/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 38371db540..efa3b59d04 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -9094,7 +9094,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
             - Hardware watchpoints.
            Hardware breakpoints have already been handled and skip this code.
          */
-        switch(dc->base.is_jmp) {
+        switch (dc->base.is_jmp) {
         case DISAS_NEXT:
         case DISAS_TOO_MANY:
             gen_goto_tb(dc, 1, dc->base.pc_next);
-- 
2.29.0-rc1



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

* Re: [PATCH 1/3] target/arm: add spaces around operator
  2020-11-03 11:45 [PATCH 1/3] target/arm: add spaces around operator Xinhao Zhang
  2020-11-03 11:45 ` [PATCH 2/3] target/arm: Don't use '#' flag of printf format Xinhao Zhang
  2020-11-03 11:45 ` [PATCH 3/3] target/arm: add space before the open parenthesis '(' Xinhao Zhang
@ 2020-11-04 18:04 ` Peter Maydell
  2020-11-05 10:20   ` 答复: " zhangxinhao
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2020-11-04 18:04 UTC (permalink / raw)
  To: Xinhao Zhang; +Cc: AlexChen, QEMU Trivial, qemu-arm, QEMU Developers, dengkai1

On Tue, 3 Nov 2020 at 11:47, Xinhao Zhang <zhangxinhao1@huawei.com> wrote:
>
> Fix code style. Operator needs spaces both sides.

Thanks; I have applied this series to target-arm.next.

For future patch submissions, please could you include a
cover letter if you're submitting a series with more
than one patch in it? (Single patches don't need a cover
letter). The individual patches should all then be
follow-ups to the cover letter (in the usual way that
git format-patch --cover-letter sets up).

(We document this and other conventions for our code
submission process at:
https://wiki.qemu.org/Contribute/SubmitAPatch )

thanks
-- PMM


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

* 答复: [PATCH 1/3] target/arm: add spaces around operator
  2020-11-04 18:04 ` [PATCH 1/3] target/arm: add spaces around operator Peter Maydell
@ 2020-11-05 10:20   ` zhangxinhao
  0 siblings, 0 replies; 5+ messages in thread
From: zhangxinhao @ 2020-11-05 10:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Chenzhendong (alex),
	QEMU Trivial, qemu-arm, QEMU Developers, dengkai (A)

Thanks for advise. I will study the documents and include a cover letter in next patch series submissions :)

-----邮件原件-----
发件人: Peter Maydell [mailto:peter.maydell@linaro.org] 
发送时间: 2020年11月5日 2:05
收件人: zhangxinhao <zhangxinhao1@huawei.com>
抄送: QEMU Developers <qemu-devel@nongnu.org>; qemu-arm <qemu-arm@nongnu.org>; dengkai (A) <dengkai1@huawei.com>; Chenzhendong (alex) <alex.chen@huawei.com>; QEMU Trivial <qemu-trivial@nongnu.org>
主题: Re: [PATCH 1/3] target/arm: add spaces around operator

On Tue, 3 Nov 2020 at 11:47, Xinhao Zhang <zhangxinhao1@huawei.com> wrote:
>
> Fix code style. Operator needs spaces both sides.

Thanks; I have applied this series to target-arm.next.

For future patch submissions, please could you include a cover letter if you're submitting a series with more than one patch in it? (Single patches don't need a cover letter). The individual patches should all then be follow-ups to the cover letter (in the usual way that git format-patch --cover-letter sets up).

(We document this and other conventions for our code submission process at:
https://wiki.qemu.org/Contribute/SubmitAPatch )

thanks
-- PMM

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

end of thread, other threads:[~2020-11-05 10:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 11:45 [PATCH 1/3] target/arm: add spaces around operator Xinhao Zhang
2020-11-03 11:45 ` [PATCH 2/3] target/arm: Don't use '#' flag of printf format Xinhao Zhang
2020-11-03 11:45 ` [PATCH 3/3] target/arm: add space before the open parenthesis '(' Xinhao Zhang
2020-11-04 18:04 ` [PATCH 1/3] target/arm: add spaces around operator Peter Maydell
2020-11-05 10:20   ` 答复: " zhangxinhao

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).