All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28
@ 2016-10-28 15:18 Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 01/23] filter-dump: add missing "[" Michael Tokarev
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial

Here's a next pull request for the trivial patches tree.
Nothing exciting is in there this time, small things
here and there.

Thanks,

/mjt

The following changes since commit fd209e4a773dd5a7fea79eaaffd276ebcb99e92a:

  Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging (2016-10-28 14:29:50 +0100)

are available in the git repository at:

  git://git.corpit.ru/qemu.git tags/trivial-patches-fetch

for you to fetch changes up to 630b210b9abbf362905a2096c22c5eb1d6224e77:

  Fix build for less common build directories names (2016-10-28 18:17:24 +0300)

----------------------------------------------------------------
trivial patches for 2016-10-28

----------------------------------------------------------------
Akanksha Srivastava (1):
      usb: Change *_exitfn return type from int to void

Anand J (2):
      scripts/clean-includes: added duplicate #include check
      clean-up: removed duplicate #includes

Changlong Xie (1):
      filter-dump: add missing "["

Daniel Shahaf (1):
      scripts/hxtool: fix undefined behavour of echo

Laurent Vivier (1):
      MAINTAINERS: qemu-trivial information

Marc-André Lureau (1):
      monitor: deprecate 'default' option

Michael Tokarev (1):
      qemu-options.hx: set: fix copy-paste error

Michael Walle (7):
      target-lm32: fix style issue
      target-lm32: fix LOG_DIS operand order
      target-lm32: swap operand of wcsr in LOG_DIS()
      target-lm32: disable asm logging via LOG_DIS()
      lm32: milkymist-tmu2: fix integer overflow
      target-lm32: rewrite gen_compare()
      milkymist-pfpu: fix potential integer overflow

Peter Maydell (2):
      migration: Remove unneeded NULL check from migrate_fd_error()
      s390: avoid always-true comparison in s390_pci_generate_fid()

Stefan Weil (3):
      Makefile: Fix help text for target 'installer'
      qemu-ga: Remove stray 'q' in documentation
      Fix build for less common build directories names

Thomas Huth (2):
      hw/tpm/tpm_passthrough: Simplify if-statements a little bit
      hw/block/nvme: Simplify if-statements a little bit

zhanghailiang (1):
      colo-compare: remove unused struct CompareChardevProps and 'props' variable

 MAINTAINERS                         | 11 +++++++
 Makefile                            |  2 +-
 accel.c                             |  1 -
 cputlb.c                            |  1 -
 gdbstub.c                           |  1 -
 hw/block/nvme.c                     |  4 +--
 hw/display/milkymist-tmu2.c         |  2 +-
 hw/i386/acpi-build.c                |  1 -
 hw/microblaze/boot.c                |  1 -
 hw/mips/mips_malta.c                |  1 -
 hw/misc/milkymist-pfpu.c            |  2 +-
 hw/nvram/fw_cfg.c                   |  1 -
 hw/pci-bridge/pci_expander_bridge.c |  1 -
 hw/ppc/ppc405_boards.c              |  1 -
 hw/ppc/spapr.c                      |  1 -
 hw/s390x/s390-pci-bus.c             | 10 ++-----
 hw/timer/grlib_gptimer.c            |  1 -
 hw/tpm/tpm_passthrough.c            |  6 ++--
 hw/tpm/tpm_tis.c                    |  1 -
 hw/unicore32/puv3.c                 |  1 -
 hw/usb/ccid-card-emulated.c         |  3 +-
 hw/usb/ccid-card-passthru.c         |  6 ----
 hw/usb/ccid.h                       |  2 +-
 hw/usb/dev-mtp.c                    |  1 -
 hw/usb/dev-smartcard-reader.c       | 11 ++++---
 include/hw/i386/pc.h                |  1 -
 include/monitor/monitor.h           |  2 +-
 migration/migration.c               |  2 +-
 monitor.c                           |  4 +--
 net/colo-compare.c                  |  8 ------
 qemu-ga.texi                        |  2 +-
 qemu-io-cmds.c                      |  1 -
 qemu-options.hx                     | 12 ++++----
 qmp.c                               |  1 -
 scripts/clean-includes              | 56 +++++++++++++++++++++++++++---------
 scripts/hxtool                      | 20 ++++++-------
 scripts/tracetool.py                |  2 +-
 target-i386/machine.c               |  3 --
 target-lm32/translate.c             | 57 ++++++++++++++++++-------------------
 target-mips/machine.c               |  1 -
 target-ppc/machine.c                |  1 -
 target-ppc/mem_helper.c             |  1 -
 target-sparc/machine.c              |  3 --
 target-xtensa/translate.c           |  1 -
 tests/crypto-tls-x509-helpers.h     |  3 --
 tests/vhost-user-test.c             |  2 --
 util/oslib-posix.c                  |  1 -
 vl.c                                | 12 ++------
 48 files changed, 121 insertions(+), 148 deletions(-)

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

* [Qemu-devel] [PULL 01/23] filter-dump: add missing "["
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 02/23] hw/tpm/tpm_passthrough: Simplify if-statements a little bit Michael Tokarev
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Changlong Xie, qemu-trivial, Michael Tokarev

From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>

Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index b1fbdb0..c209b53 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3902,7 +3902,7 @@ colo secondary:
 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
 -object filter-rewriter,id=rew0,netdev=hn0,queue=all
 
-@item -object filter-dump,id=@var{id},netdev=@var{dev},file=@var{filename}][,maxlen=@var{len}]
+@item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}]
 
 Dump the network traffic on netdev @var{dev} to the file specified by
 @var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
-- 
2.1.4

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

* [Qemu-devel] [PULL 02/23] hw/tpm/tpm_passthrough: Simplify if-statements a little bit
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 01/23] filter-dump: add missing "[" Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 03/23] target-lm32: fix style issue Michael Tokarev
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

The condition  '!A || (A && B)' is equivalent to '!A || B'

Buglink: https://bugs.launchpad.net/qemu/+bug/1464611
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/tpm/tpm_passthrough.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index e88c0d2..9234eb3 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -165,8 +165,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
 
     ret = tpm_passthrough_unix_write(tpm_pt->tpm_fd, in, in_len);
     if (ret != in_len) {
-        if (!tpm_pt->tpm_op_canceled ||
-            (tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
+        if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) {
             error_report("tpm_passthrough: error while transmitting data "
                          "to TPM: %s (%i)",
                          strerror(errno), errno);
@@ -178,8 +177,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
 
     ret = tpm_passthrough_unix_read(tpm_pt->tpm_fd, out, out_len);
     if (ret < 0) {
-        if (!tpm_pt->tpm_op_canceled ||
-            (tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
+        if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) {
             error_report("tpm_passthrough: error while reading data from "
                          "TPM: %s (%i)",
                          strerror(errno), errno);
-- 
2.1.4

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

* [Qemu-devel] [PULL 03/23] target-lm32: fix style issue
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 01/23] filter-dump: add missing "[" Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 02/23] hw/tpm/tpm_passthrough: Simplify if-statements a little bit Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 04/23] target-lm32: fix LOG_DIS operand order Michael Tokarev
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

Both branches of the ternary operator have the same expressions. Drop the
operator.

This fixes: https://bugs.launchpad.net/qemu/+bug/1414293

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-lm32/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 2d8caeb..534c17c 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -343,7 +343,7 @@ static void dec_calli(DisasContext *dc)
 static inline void gen_compare(DisasContext *dc, int cond)
 {
     int rX = (dc->format == OP_FMT_RR) ? dc->r2 : dc->r1;
-    int rY = (dc->format == OP_FMT_RR) ? dc->r0 : dc->r0;
+    int rY = dc->r0;
     int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1;
     int i;
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 04/23] target-lm32: fix LOG_DIS operand order
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (2 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 03/23] target-lm32: fix style issue Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 05/23] target-lm32: swap operand of wcsr in LOG_DIS() Michael Tokarev
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

The order of most opcodes with immediates was wrong (according to the
reference manual) in the (debug) logging. Additionally, one operand for the
andhi instruction was completly wrong. Fix these.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-lm32/translate.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 534c17c..dc64cc6 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -211,7 +211,7 @@ static void dec_and(DisasContext *dc)
 
 static void dec_andhi(DisasContext *dc)
 {
-    LOG_DIS("andhi r%d, r%d, %d\n", dc->r2, dc->r0, dc->imm16);
+    LOG_DIS("andhi r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm16);
 
     tcg_gen_andi_tl(cpu_R[dc->r1], cpu_R[dc->r0], (dc->imm16 << 16));
 }
@@ -274,7 +274,7 @@ static inline void gen_cond_branch(DisasContext *dc, int cond)
 
 static void dec_be(DisasContext *dc)
 {
-    LOG_DIS("be r%d, r%d, %d\n", dc->r0, dc->r1,
+    LOG_DIS("be r%d, r%d, %d\n", dc->r1, dc->r0,
             sign_extend(dc->imm16, 16) * 4);
 
     gen_cond_branch(dc, TCG_COND_EQ);
@@ -282,7 +282,7 @@ static void dec_be(DisasContext *dc)
 
 static void dec_bg(DisasContext *dc)
 {
-    LOG_DIS("bg r%d, r%d, %d\n", dc->r0, dc->r1,
+    LOG_DIS("bg r%d, r%d, %d\n", dc->r1, dc->r0,
             sign_extend(dc->imm16, 16 * 4));
 
     gen_cond_branch(dc, TCG_COND_GT);
@@ -290,7 +290,7 @@ static void dec_bg(DisasContext *dc)
 
 static void dec_bge(DisasContext *dc)
 {
-    LOG_DIS("bge r%d, r%d, %d\n", dc->r0, dc->r1,
+    LOG_DIS("bge r%d, r%d, %d\n", dc->r1, dc->r0,
             sign_extend(dc->imm16, 16) * 4);
 
     gen_cond_branch(dc, TCG_COND_GE);
@@ -298,7 +298,7 @@ static void dec_bge(DisasContext *dc)
 
 static void dec_bgeu(DisasContext *dc)
 {
-    LOG_DIS("bgeu r%d, r%d, %d\n", dc->r0, dc->r1,
+    LOG_DIS("bgeu r%d, r%d, %d\n", dc->r1, dc->r0,
             sign_extend(dc->imm16, 16) * 4);
 
     gen_cond_branch(dc, TCG_COND_GEU);
@@ -306,7 +306,7 @@ static void dec_bgeu(DisasContext *dc)
 
 static void dec_bgu(DisasContext *dc)
 {
-    LOG_DIS("bgu r%d, r%d, %d\n", dc->r0, dc->r1,
+    LOG_DIS("bgu r%d, r%d, %d\n", dc->r1, dc->r0,
             sign_extend(dc->imm16, 16) * 4);
 
     gen_cond_branch(dc, TCG_COND_GTU);
@@ -314,7 +314,7 @@ static void dec_bgu(DisasContext *dc)
 
 static void dec_bne(DisasContext *dc)
 {
-    LOG_DIS("bne r%d, r%d, %d\n", dc->r0, dc->r1,
+    LOG_DIS("bne r%d, r%d, %d\n", dc->r1, dc->r0,
             sign_extend(dc->imm16, 16) * 4);
 
     gen_cond_branch(dc, TCG_COND_NE);
@@ -367,7 +367,7 @@ static inline void gen_compare(DisasContext *dc, int cond)
 static void dec_cmpe(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("cmpei r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("cmpei r%d, r%d, %d\n", dc->r1, dc->r0,
                 sign_extend(dc->imm16, 16));
     } else {
         LOG_DIS("cmpe r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -379,7 +379,7 @@ static void dec_cmpe(DisasContext *dc)
 static void dec_cmpg(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("cmpgi r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("cmpgi r%d, r%d, %d\n", dc->r1, dc->r0,
                 sign_extend(dc->imm16, 16));
     } else {
         LOG_DIS("cmpg r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -391,7 +391,7 @@ static void dec_cmpg(DisasContext *dc)
 static void dec_cmpge(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("cmpgei r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("cmpgei r%d, r%d, %d\n", dc->r1, dc->r0,
                 sign_extend(dc->imm16, 16));
     } else {
         LOG_DIS("cmpge r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -403,7 +403,7 @@ static void dec_cmpge(DisasContext *dc)
 static void dec_cmpgeu(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("cmpgeui r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("cmpgeui r%d, r%d, %d\n", dc->r1, dc->r0,
                 zero_extend(dc->imm16, 16));
     } else {
         LOG_DIS("cmpgeu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -415,7 +415,7 @@ static void dec_cmpgeu(DisasContext *dc)
 static void dec_cmpgu(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("cmpgui r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("cmpgui r%d, r%d, %d\n", dc->r1, dc->r0,
                 zero_extend(dc->imm16, 16));
     } else {
         LOG_DIS("cmpgu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -427,7 +427,7 @@ static void dec_cmpgu(DisasContext *dc)
 static void dec_cmpne(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("cmpnei r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("cmpnei r%d, r%d, %d\n", dc->r1, dc->r0,
                 sign_extend(dc->imm16, 16));
     } else {
         LOG_DIS("cmpne r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -539,7 +539,7 @@ static void dec_modu(DisasContext *dc)
 static void dec_mul(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("muli r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("muli r%d, r%d, %d\n", dc->r1, dc->r0,
                 sign_extend(dc->imm16, 16));
     } else {
         LOG_DIS("mul r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -563,7 +563,7 @@ static void dec_mul(DisasContext *dc)
 static void dec_nor(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("nori r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("nori r%d, r%d, %d\n", dc->r1, dc->r0,
                 zero_extend(dc->imm16, 16));
     } else {
         LOG_DIS("nor r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
@@ -959,7 +959,7 @@ static void dec_wcsr(DisasContext *dc)
 static void dec_xnor(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("xnori r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("xnori r%d, r%d, %d\n", dc->r1, dc->r0,
                 zero_extend(dc->imm16, 16));
     } else {
         if (dc->r1 == R_R0) {
@@ -981,7 +981,7 @@ static void dec_xnor(DisasContext *dc)
 static void dec_xor(DisasContext *dc)
 {
     if (dc->format == OP_FMT_RI) {
-        LOG_DIS("xori r%d, r%d, %d\n", dc->r0, dc->r1,
+        LOG_DIS("xori r%d, r%d, %d\n", dc->r1, dc->r0,
                 zero_extend(dc->imm16, 16));
     } else {
         LOG_DIS("xor r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
-- 
2.1.4

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

* [Qemu-devel] [PULL 05/23] target-lm32: swap operand of wcsr in LOG_DIS()
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (3 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 04/23] target-lm32: fix LOG_DIS operand order Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 06/23] target-lm32: disable asm logging via LOG_DIS() Michael Tokarev
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

Be consistent with the reference manual.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-lm32/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index dc64cc6..fa8416a 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -865,7 +865,7 @@ static void dec_wcsr(DisasContext *dc)
 {
     int no;
 
-    LOG_DIS("wcsr r%d, %d\n", dc->r1, dc->csr);
+    LOG_DIS("wcsr %d, r%d\n", dc->csr, dc->r1);
 
     switch (dc->csr) {
     case CSR_IE:
-- 
2.1.4

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

* [Qemu-devel] [PULL 06/23] target-lm32: disable asm logging via LOG_DIS()
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (4 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 05/23] target-lm32: swap operand of wcsr in LOG_DIS() Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 07/23] lm32: milkymist-tmu2: fix integer overflow Michael Tokarev
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

The lm32 target already has a disassembler which logs the assembly
instructions with "-d in_asm". Therefore, turn of the LOG_DIS() macro to
prevent logging the assembly instructions twice. Also turn the macro in a
one which is always compiled to catch any errors while the macro is turned
off.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-lm32/translate.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index fa8416a..792637f 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -33,12 +33,14 @@
 #include "exec/log.h"
 
 
-#define DISAS_LM32 1
-#if DISAS_LM32
-#  define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
-#else
-#  define LOG_DIS(...) do { } while (0)
-#endif
+#define DISAS_LM32 0
+
+#define LOG_DIS(...) \
+    do { \
+        if (DISAS_LM32) { \
+            qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__); \
+        } \
+    } while (0)
 
 #define EXTRACT_FIELD(src, start, end) \
             (((src) >> start) & ((1 << (end - start + 1)) - 1))
-- 
2.1.4

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

* [Qemu-devel] [PULL 07/23] lm32: milkymist-tmu2: fix integer overflow
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (5 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 06/23] target-lm32: disable asm logging via LOG_DIS() Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 08/23] target-lm32: rewrite gen_compare() Michael Tokarev
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

Don't truncate the multiplication and do a 64 bit one instead because
because the result is stored in a 64 bit variable.

Spotted by coverity, CID 1167561.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/display/milkymist-tmu2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c
index 9c00184..5c666f9 100644
--- a/hw/display/milkymist-tmu2.c
+++ b/hw/display/milkymist-tmu2.c
@@ -213,7 +213,7 @@ static void tmu2_start(MilkymistTMU2State *s)
     /* Read the QEMU source framebuffer into an OpenGL texture */
     glGenTextures(1, &texture);
     glBindTexture(GL_TEXTURE_2D, texture);
-    fb_len = 2*s->regs[R_TEXHRES]*s->regs[R_TEXVRES];
+    fb_len = 2ULL * s->regs[R_TEXHRES] * s->regs[R_TEXVRES];
     fb = cpu_physical_memory_map(s->regs[R_TEXFBUF], &fb_len, 0);
     if (fb == NULL) {
         glDeleteTextures(1, &texture);
-- 
2.1.4

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

* [Qemu-devel] [PULL 08/23] target-lm32: rewrite gen_compare()
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (6 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 07/23] lm32: milkymist-tmu2: fix integer overflow Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 09/23] hw/block/nvme: Simplify if-statements a little bit Michael Tokarev
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

Drop the rX, rY and rZ stuff and use dc->r{0,1,2} directly. This should
also fix the false positive in coverity CID 1005720.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-lm32/translate.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 792637f..842af63 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -344,9 +344,6 @@ static void dec_calli(DisasContext *dc)
 
 static inline void gen_compare(DisasContext *dc, int cond)
 {
-    int rX = (dc->format == OP_FMT_RR) ? dc->r2 : dc->r1;
-    int rY = dc->r0;
-    int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1;
     int i;
 
     if (dc->format == OP_FMT_RI) {
@@ -360,9 +357,9 @@ static inline void gen_compare(DisasContext *dc, int cond)
             break;
         }
 
-        tcg_gen_setcondi_tl(cond, cpu_R[rX], cpu_R[rY], i);
+        tcg_gen_setcondi_tl(cond, cpu_R[dc->r1], cpu_R[dc->r0], i);
     } else {
-        tcg_gen_setcond_tl(cond, cpu_R[rX], cpu_R[rY], cpu_R[rZ]);
+        tcg_gen_setcond_tl(cond, cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]);
     }
 }
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 09/23] hw/block/nvme: Simplify if-statements a little bit
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (7 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 08/23] target-lm32: rewrite gen_compare() Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 10/23] milkymist-pfpu: fix potential integer overflow Michael Tokarev
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

The condition  '!A || (A && B)' is equivalent to '!A || B'.

Buglink: https://bugs.launchpad.net/qemu/+bug/1464611
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/block/nvme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index b380142..d479fd2 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -375,7 +375,7 @@ static uint16_t nvme_create_sq(NvmeCtrl *n, NvmeCmd *cmd)
     if (!cqid || nvme_check_cqid(n, cqid)) {
         return NVME_INVALID_CQID | NVME_DNR;
     }
-    if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) {
+    if (!sqid || !nvme_check_sqid(n, sqid)) {
         return NVME_INVALID_QID | NVME_DNR;
     }
     if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) {
@@ -449,7 +449,7 @@ static uint16_t nvme_create_cq(NvmeCtrl *n, NvmeCmd *cmd)
     uint16_t qflags = le16_to_cpu(c->cq_flags);
     uint64_t prp1 = le64_to_cpu(c->prp1);
 
-    if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) {
+    if (!cqid || !nvme_check_cqid(n, cqid)) {
         return NVME_INVALID_CQID | NVME_DNR;
     }
     if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) {
-- 
2.1.4

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

* [Qemu-devel] [PULL 10/23] milkymist-pfpu: fix potential integer overflow
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (8 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 09/23] hw/block/nvme: Simplify if-statements a little bit Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 11/23] colo-compare: remove unused struct CompareChardevProps and 'props' variable Michael Tokarev
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Walle, qemu-trivial, Michael Tokarev

From: Michael Walle <michael@walle.cc>

Since the lm32 is a 32 bit architecture, just return a 32 bit value which
is then converted to a 64 bit value.

Spotted by coverity, CID 1005506.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/misc/milkymist-pfpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c
index 1da21a6..3ca2589 100644
--- a/hw/misc/milkymist-pfpu.c
+++ b/hw/misc/milkymist-pfpu.c
@@ -137,7 +137,7 @@ struct MilkymistPFPUState {
 };
 typedef struct MilkymistPFPUState MilkymistPFPUState;
 
-static inline hwaddr
+static inline uint32_t
 get_dma_address(uint32_t base, uint32_t x, uint32_t y)
 {
     return base + 8 * (128 * y + x);
-- 
2.1.4

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

* [Qemu-devel] [PULL 11/23] colo-compare: remove unused struct CompareChardevProps and 'props' variable
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (9 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 10/23] milkymist-pfpu: fix potential integer overflow Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 12/23] MAINTAINERS: qemu-trivial information Michael Tokarev
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: zhanghailiang, qemu-trivial, Michael Tokarev

From: zhanghailiang <zhang.zhanghailiang@huawei.com>

After commit 0a73336d, 'props' variable in find_and_check_chardev()
is unused. Remove it, togther with struct CompareChardevProps.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 net/colo-compare.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index f791383..2089bea 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -92,10 +92,6 @@ typedef struct CompareClass {
     ObjectClass parent_class;
 } CompareClass;
 
-typedef struct CompareChardevProps {
-    bool is_socket;
-} CompareChardevProps;
-
 enum {
     PRIMARY_IN = 0,
     SECONDARY_IN,
@@ -571,8 +567,6 @@ static int find_and_check_chardev(CharDriverState **chr,
                                   char *chr_name,
                                   Error **errp)
 {
-    CompareChardevProps props;
-
     *chr = qemu_chr_find(chr_name);
     if (*chr == NULL) {
         error_setg(errp, "Device '%s' not found",
@@ -580,8 +574,6 @@ static int find_and_check_chardev(CharDriverState **chr,
         return 1;
     }
 
-    memset(&props, 0, sizeof(props));
-
     if (!qemu_chr_has_feature(*chr, QEMU_CHAR_FEATURE_RECONNECTABLE)) {
         error_setg(errp, "chardev \"%s\" is not reconnectable",
                    chr_name);
-- 
2.1.4

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

* [Qemu-devel] [PULL 12/23] MAINTAINERS: qemu-trivial information
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (10 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 11/23] colo-compare: remove unused struct CompareChardevProps and 'props' variable Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 13/23] usb: Change *_exitfn return type from int to void Michael Tokarev
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev

From: Laurent Vivier <laurent@vivier.eu>

Information about "qemu-trivial" ML can be found in the wiki:

    http://wiki.qemu.org/Contribute/TrivialPatches

But the first place where a developer looks is the file MAINTAINERS.

This also allows the get_maintainer.pl script to display
the qemu-trivial ML address when the mail subject contains "trivial".

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 MAINTAINERS | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index b01fec0..a87965f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -63,6 +63,17 @@ W: http://wiki.qemu.org/SecurityProcess
 M: Michael S. Tsirkin <mst@redhat.com>
 L: secalert@redhat.com
 
+Trivial patches
+---------------
+Trivial patches
+M: Michael Tokarev <mjt@tls.msk.ru>
+M: Laurent Vivier <laurent@vivier.eu>
+S: Maintained
+L: qemu-trivial@nongnu.org
+K: ^Subject:.*(?i)trivial
+T: git git://git.corpit.ru/qemu.git trivial-patches
+T: git git://github.com/vivier/qemu.git trivial-patches
+
 Guest CPU cores (TCG):
 ----------------------
 Overall
-- 
2.1.4

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

* [Qemu-devel] [PULL 13/23] usb: Change *_exitfn return type from int to void
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (11 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 12/23] MAINTAINERS: qemu-trivial information Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 14/23] qemu-options.hx: set: fix copy-paste error Michael Tokarev
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Akanksha Srivastava, qemu-trivial, Michael Tokarev

From: Akanksha Srivastava <akanksha.dlf@gmail.com>

The *_exitfn functions cannot fail and should not be
returning int.
This also removes the passthru_exitfn since this callback
does nothing as of now.
This was suggested as a Bite-sized task for code cleanup.
Signed-off-by: Akanksha Srivastava <akanksha.dlf@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/usb/ccid-card-emulated.c   |  3 +--
 hw/usb/ccid-card-passthru.c   |  6 ------
 hw/usb/ccid.h                 |  2 +-
 hw/usb/dev-smartcard-reader.c | 11 +++++------
 4 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 3213f9f..eceb5f3 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -547,7 +547,7 @@ static int emulated_initfn(CCIDCardState *base)
     return 0;
 }
 
-static int emulated_exitfn(CCIDCardState *base)
+static void emulated_exitfn(CCIDCardState *base)
 {
     EmulatedState *card = EMULATED_CCID_CARD(base);
     VEvent *vevent = vevent_new(VEVENT_LAST, NULL, NULL);
@@ -564,7 +564,6 @@ static int emulated_exitfn(CCIDCardState *base)
     qemu_mutex_destroy(&card->handle_apdu_mutex);
     qemu_mutex_destroy(&card->vreader_mutex);
     qemu_mutex_destroy(&card->event_list_mutex);
-    return 0;
 }
 
 static Property emulated_card_properties[] = {
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 325129a..88cb6d8 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -365,11 +365,6 @@ static int passthru_initfn(CCIDCardState *base)
     return 0;
 }
 
-static int passthru_exitfn(CCIDCardState *base)
-{
-    return 0;
-}
-
 static VMStateDescription passthru_vmstate = {
     .name = "ccid-card-passthru",
     .version_id = 1,
@@ -396,7 +391,6 @@ static void passthru_class_initfn(ObjectClass *klass, void *data)
     CCIDCardClass *cc = CCID_CARD_CLASS(klass);
 
     cc->initfn = passthru_initfn;
-    cc->exitfn = passthru_exitfn;
     cc->get_atr = passthru_get_atr;
     cc->apdu_from_guest = passthru_apdu_from_guest;
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h
index 9334da8..1f07011 100644
--- a/hw/usb/ccid.h
+++ b/hw/usb/ccid.h
@@ -33,7 +33,7 @@ typedef struct CCIDCardClass {
     void (*apdu_from_guest)(CCIDCardState *card,
                             const uint8_t *apdu,
                             uint32_t len);
-    int (*exitfn)(CCIDCardState *card);
+    void (*exitfn)(CCIDCardState *card);
     int (*initfn)(CCIDCardState *card);
 } CCIDCardClass;
 
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index af4b851..89e11b6 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -508,14 +508,14 @@ static void ccid_card_apdu_from_guest(CCIDCardState *card,
     }
 }
 
-static int ccid_card_exitfn(CCIDCardState *card)
+static void ccid_card_exitfn(CCIDCardState *card)
 {
     CCIDCardClass *cc = CCID_CARD_GET_CLASS(card);
 
     if (cc->exitfn) {
-        return cc->exitfn(card);
+        cc->exitfn(card);
     }
-    return 0;
+
 }
 
 static int ccid_card_initfn(CCIDCardState *card)
@@ -1279,7 +1279,6 @@ void ccid_card_card_inserted(CCIDCardState *card)
 
 static int ccid_card_exit(DeviceState *qdev)
 {
-    int ret = 0;
     CCIDCardState *card = CCID_CARD(qdev);
     USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
     USBCCIDState *s = USB_CCID_DEV(dev);
@@ -1287,9 +1286,9 @@ static int ccid_card_exit(DeviceState *qdev)
     if (ccid_card_inserted(s)) {
         ccid_card_card_removed(card);
     }
-    ret = ccid_card_exitfn(card);
+    ccid_card_exitfn(card);
     s->card = NULL;
-    return ret;
+    return 0;
 }
 
 static int ccid_card_init(DeviceState *qdev)
-- 
2.1.4

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

* [Qemu-devel] [PULL 14/23] qemu-options.hx: set: fix copy-paste error
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (12 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 13/23] usb: Change *_exitfn return type from int to void Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 15/23] scripts/hxtool: fix undefined behavour of echo Michael Tokarev
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial

Reported-By: Daniel Shahaf <danielsh@apache.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index c209b53..f296406 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -172,7 +172,7 @@ DEF("set", HAS_ARG, QEMU_OPTION_set,
 STEXI
 @item -set @var{group}.@var{id}.@var{arg}=@var{value}
 @findex -set
-Set parameter @var{arg} for item @var{id} of type @var{group}\n"
+Set parameter @var{arg} for item @var{id} of type @var{group}
 ETEXI
 
 DEF("global", HAS_ARG, QEMU_OPTION_global,
-- 
2.1.4

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

* [Qemu-devel] [PULL 15/23] scripts/hxtool: fix undefined behavour of echo
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (13 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 14/23] qemu-options.hx: set: fix copy-paste error Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 16/23] migration: Remove unneeded NULL check from migrate_fd_error() Michael Tokarev
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel Shahaf, qemu-trivial, Michael Tokarev

From: Daniel Shahaf <danielsh@apache.org>

Avoid undefined behaviour of echo(1) with backslashes in arguments
The behaviour is implementation-defined, different /bin/sh's behave
differently.

Signed-off-by: Daniel Shahaf <danielsh@apache.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/hxtool | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/scripts/hxtool b/scripts/hxtool
index 995bb7f..04f7d7b 100644
--- a/scripts/hxtool
+++ b/scripts/hxtool
@@ -26,32 +26,32 @@ hxtotexi()
             ;;
             STEXI*)
             if test $flag -eq 1 ; then
-                echo "line $line: syntax error: expected ETEXI, found $str" >&2
+                printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2
                 exit 1
             fi
             flag=1
             ;;
             ETEXI*)
             if test $flag -ne 1 ; then
-                echo "line $line: syntax error: expected STEXI, found $str" >&2
+                printf "line %d: syntax error: expected STEXI, found '%s'\n" "$line" "$str" >&2
                 exit 1
             fi
             flag=0
             ;;
             SQMP*|EQMP*)
             if test $flag -eq 1 ; then
-                echo "line $line: syntax error: expected ETEXI, found $str" >&2
+                printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2
                 exit 1
             fi
             ;;
             DEFHEADING*)
-            echo "$(expr "$str" : "DEFHEADING(\(.*\))")"
+            printf '%s\n' "$(expr "$str" : "DEFHEADING(\(.*\))")"
             ;;
             ARCHHEADING*)
-            echo "$(expr "$str" : "ARCHHEADING(\(.*\),.*)")"
+            printf '%s\n' "$(expr "$str" : "ARCHHEADING(\(.*\),.*)")"
             ;;
             *)
-            test $flag -eq 1 && echo "$str"
+            test $flag -eq 1 && printf '%s\n' "$str"
             ;;
         esac
         line=$((line+1))
@@ -69,26 +69,26 @@ hxtoqmp()
             ;;
             SQMP*)
             if test $flag -eq 1 ; then
-                echo "line $line: syntax error: expected EQMP, found $str" >&2
+                printf "line %d: syntax error: expected EQMP, found '%s'\n" "$line" "$str" >&2
                 exit 1
             fi
             flag=1
             ;;
             EQMP*)
             if test $flag -ne 1 ; then
-                echo "line $line: syntax error: expected SQMP, found $str" >&2
+                printf "line %d: syntax error: expected SQMP, found '%s'\n" "$line" "$str" >&2
                 exit 1
             fi
             flag=0
             ;;
             STEXI*|ETEXI*)
             if test $flag -eq 1 ; then
-                echo "line $line: syntax error: expected EQMP, found $str" >&2
+                printf "line %d: syntax error: expected EQMP, found '%s'\n" "$line" "$str" >&2
                 exit 1
             fi
             ;;
             *)
-            test $flag -eq 1 && echo "$str"
+            test $flag -eq 1 && printf '%s\n' "$str"
             ;;
         esac
         line=$((line+1))
-- 
2.1.4

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

* [Qemu-devel] [PULL 16/23] migration: Remove unneeded NULL check from migrate_fd_error()
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (14 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 15/23] scripts/hxtool: fix undefined behavour of echo Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 17/23] s390: avoid always-true comparison in s390_pci_generate_fid() Michael Tokarev
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev

From: Peter Maydell <peter.maydell@linaro.org>

All the callers of migrate_fd_error() pass a non-NULL
error parameter, and if any did pass NULL then we would
segfault in error_copy(), so remove the unnecessary
NULL check earlier in the function.
(Spotted by Coverity.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index 4d417b7..d216b93 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -922,7 +922,7 @@ static void migrate_fd_cleanup(void *opaque)
 
 void migrate_fd_error(MigrationState *s, const Error *error)
 {
-    trace_migrate_fd_error(error ? error_get_pretty(error) : "");
+    trace_migrate_fd_error(error_get_pretty(error));
     assert(s->to_dst_file == NULL);
     migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
                       MIGRATION_STATUS_FAILED);
-- 
2.1.4

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

* [Qemu-devel] [PULL 17/23] s390: avoid always-true comparison in s390_pci_generate_fid()
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (15 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 16/23] migration: Remove unneeded NULL check from migrate_fd_error() Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 18/23] Makefile: Fix help text for target 'installer' Michael Tokarev
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev

From: Peter Maydell <peter.maydell@linaro.org>

Coverity points out that the comparison "fid <= ZPCI_MAX_FID"
in s390_pci_generate_fid() is always true (because fid
is 32 bits and ZPCI_MAX_FID is 0xffffffff). This isn't a
bug because the real loop termination condition is
expressed later via an "if (...) break;" inside the loop,
but it is a bit odd. Rephrase the loop to avoid the
unnecessary duplicate-but-never-true conditional.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/s390x/s390-pci-bus.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index b7f8bca..bbbe0b1 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -809,17 +809,11 @@ static uint32_t s390_pci_generate_fid(Error **errp)
 {
     uint32_t fid = 0;
 
-    while (fid <= ZPCI_MAX_FID) {
+    do {
         if (!s390_pci_find_dev_by_fid(fid)) {
             return fid;
         }
-
-        if (fid == ZPCI_MAX_FID) {
-            break;
-        }
-
-        fid++;
-    }
+    } while (fid++ != ZPCI_MAX_FID);
 
     error_setg(errp, "no free fid could be found");
     return 0;
-- 
2.1.4

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

* [Qemu-devel] [PULL 18/23] Makefile: Fix help text for target 'installer'
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (16 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 17/23] s390: avoid always-true comparison in s390_pci_generate_fid() Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 19/23] qemu-ga: Remove stray 'q' in documentation Michael Tokarev
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, qemu-trivial, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

The NSIS based installer currently does not install qemu-ga.
It installs the executables and other files for the QEMU system emulation.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3bcb056..69595ad 100644
--- a/Makefile
+++ b/Makefile
@@ -695,7 +695,7 @@ help:
 	@echo  ''
 ifdef CONFIG_WIN32
 	@echo  'Windows targets:'
-	@echo  '  installer       - Build NSIS-based installer for qemu-ga'
+	@echo  '  installer       - Build NSIS-based installer for QEMU'
 ifdef QEMU_GA_MSI_ENABLED
 	@echo  '  msi             - Build MSI-based installer for qemu-ga'
 endif
-- 
2.1.4

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

* [Qemu-devel] [PULL 19/23] qemu-ga: Remove stray 'q' in documentation
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (17 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 18/23] Makefile: Fix help text for target 'installer' Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 20/23] monitor: deprecate 'default' option Michael Tokarev
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, qemu-trivial, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-ga.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-ga.texi b/qemu-ga.texi
index 0e53bf6..4c7a8fd 100644
--- a/qemu-ga.texi
+++ b/qemu-ga.texi
@@ -30,7 +30,7 @@ set user's password
 @end itemize
 
 qemu-ga will read a system configuration file on startup (located at
-q@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining
+@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining
 configuration options on the command line. For the same key, the last
 option wins, but the lists accumulate (see below for configuration
 file format).
-- 
2.1.4

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

* [Qemu-devel] [PULL 20/23] monitor: deprecate 'default' option
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (18 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 19/23] qemu-ga: Remove stray 'q' in documentation Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 21/23] scripts/clean-includes: added duplicate #include check Michael Tokarev
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, qemu-trivial, Michael Tokarev

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This option does nothing since commit 06ac27f.  Deprecate it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/monitor/monitor.h |  2 +-
 monitor.c                 |  2 +-
 qemu-options.hx           |  8 ++++----
 vl.c                      | 11 +++--------
 4 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index a714d8e..8cc532e 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -9,7 +9,7 @@
 extern Monitor *cur_mon;
 
 /* flags for monitor_init */
-#define MONITOR_IS_DEFAULT    0x01
+/* 0x01 unused */
 #define MONITOR_USE_READLINE  0x02
 #define MONITOR_USE_CONTROL   0x04
 #define MONITOR_USE_PRETTY    0x08
diff --git a/monitor.c b/monitor.c
index 21dcfb2..c4b6e26 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4094,7 +4094,7 @@ QemuOptsList qemu_mon_opts = {
             .name = "chardev",
             .type = QEMU_OPT_STRING,
         },{
-            .name = "default",
+            .name = "default",  /* deprecated */
             .type = QEMU_OPT_BOOL,
         },{
             .name = "pretty",
diff --git a/qemu-options.hx b/qemu-options.hx
index f296406..95332cc 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2239,7 +2239,7 @@ two serial ports and the QEMU monitor:
 
 @example
 -chardev stdio,mux=on,id=char0 \
--mon chardev=char0,mode=readline,default \
+-mon chardev=char0,mode=readline \
 -serial chardev:char0 \
 -serial chardev:char0
 @end example
@@ -2250,7 +2250,7 @@ multiplexed between the QEMU monitor and a parallel port:
 
 @example
 -chardev stdio,mux=on,id=char0 \
--mon chardev=char0,mode=readline,default \
+-mon chardev=char0,mode=readline \
 -parallel chardev:char0 \
 -chardev tcp,...,mux=on,id=char1 \
 -serial chardev:char1 \
@@ -3112,9 +3112,9 @@ Like -qmp but uses pretty JSON formatting.
 ETEXI
 
 DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
-    "-mon [chardev=]name[,mode=readline|control][,default]\n", QEMU_ARCH_ALL)
+    "-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL)
 STEXI
-@item -mon [chardev=]name[,mode=readline|control][,default]
+@item -mon [chardev=]name[,mode=readline|control]
 @findex -mon
 Setup monitor on chardev @var{name}.
 ETEXI
diff --git a/vl.c b/vl.c
index 74dfe4e..496e655 100644
--- a/vl.c
+++ b/vl.c
@@ -2408,8 +2408,9 @@ static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
     if (qemu_opt_get_bool(opts, "pretty", 0))
         flags |= MONITOR_USE_PRETTY;
 
-    if (qemu_opt_get_bool(opts, "default", 0))
-        flags |= MONITOR_IS_DEFAULT;
+    if (qemu_opt_get_bool(opts, "default", 0)) {
+        error_report("option 'default' does nothing and is deprecated");
+    }
 
     chardev = qemu_opt_get(opts, "chardev");
     chr = qemu_chr_find(chardev);
@@ -2428,16 +2429,12 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
     QemuOpts *opts;
     const char *p;
     char label[32];
-    int def = 0;
 
     if (strstart(optarg, "chardev:", &p)) {
         snprintf(label, sizeof(label), "%s", p);
     } else {
         snprintf(label, sizeof(label), "compat_monitor%d",
                  monitor_device_index);
-        if (monitor_device_index == 0) {
-            def = 1;
-        }
         opts = qemu_chr_parse_compat(label, optarg);
         if (!opts) {
             error_report("parse error: %s", optarg);
@@ -2449,8 +2446,6 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
     qemu_opt_set(opts, "mode", mode, &error_abort);
     qemu_opt_set(opts, "chardev", label, &error_abort);
     qemu_opt_set_bool(opts, "pretty", pretty, &error_abort);
-    if (def)
-        qemu_opt_set(opts, "default", "on", &error_abort);
     monitor_device_index++;
 }
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 21/23] scripts/clean-includes: added duplicate #include check
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (19 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 20/23] monitor: deprecate 'default' option Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 22/23] clean-up: removed duplicate #includes Michael Tokarev
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anand J, qemu-trivial, Michael Tokarev

From: Anand J <anand.indukala@gmail.com>

Enhance the clean-includes script to optionally check for duplicate #include
entries.

Script might output false positive entries as well. Such entries should
not be removed. So if it finds any duplicate entries script will
terminate with an exit status 1. Then each and every file should be
checked manually and corrected if necessary.

In order to enable the check use --check-dup-head option with
scripts/clean-includes.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Anand J <anand.indukala@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/clean-includes | 56 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 14 deletions(-)

diff --git a/scripts/clean-includes b/scripts/clean-includes
index 4412a55..dd938da 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -14,15 +14,18 @@
 # the top-level directory.
 
 # Usage:
-#   clean-includes [--git subjectprefix] file ...
+#   clean-includes [--git subjectprefix] [--check-dup-head] file ...
 # or
-#   clean-includes [--git subjectprefix] --all
+#   clean-includes [--git subjectprefix] [--check-dup-head] --all
 #
 # If the --git subjectprefix option is given, then after making
 # the changes to the files this script will create a git commit
 # with the subject line "subjectprefix: Clean up includes"
 # and a boilerplate commit message.
 #
+# If --check-dup-head is specified, additionally check for duplicate
+# header includes.
+#
 # Using --all will cause clean-includes to run on the whole source
 # tree (excluding certain directories which are known not to need
 # handling).
@@ -45,23 +48,40 @@
 
 
 GIT=no
+DUPHEAD=no
 
 # Extended regular expression defining files to ignore when using --all
 XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios|disas/libvixl)'
 
-if [ $# -ne 0 ] && [ "$1" = "--git" ]; then
-    if [ $# -eq 1 ]; then
-        echo "--git option requires an argument"
-        exit 1
-    fi
-    GITSUBJ="$2"
-    GIT=yes
-    shift
-    shift
-fi
+while true
+do
+    case $1 in
+    "--git")
+         if [ $# -eq 1 ]; then
+             echo "--git option requires an argument"
+             exit 1
+         fi
+         GITSUBJ="$2"
+         GIT=yes
+         shift
+         shift
+         ;;
+    "--check-dup-head")
+        DUPHEAD=yes
+        shift
+        ;;
+    "--")
+        shift
+        break
+        ;;
+    *)
+        break
+        ;;
+   esac
+done
 
 if [ $# -eq 0 ]; then
-    echo "Usage: clean-includes [--git subjectprefix] [--all | foo.c ...]"
+    echo "Usage: clean-includes [--git subjectprefix] [--check-dup-head] [--all | foo.c ...]"
     echo "(modifies the files in place)"
     exit 1
 fi
@@ -91,7 +111,6 @@ cat >"$COCCIFILE" <<EOT
 )
 EOT
 
-
 for f in "$@"; do
   case "$f" in
     *.inc.c)
@@ -154,6 +173,15 @@ for f in "$@"; do
 
 done
 
+if [ "$DUPHEAD" = "yes" ]; then
+    egrep "^[[:space:]]*#[[:space:]]*include" "$@" | tr -d '[:blank:]' \
+        | sort | uniq -c | awk '{if ($1 > 1) print $0}'
+    if [ $? -eq 0 ]; then
+        echo "Found duplicate header file includes. Please check the above files manually."
+        exit 1
+    fi
+fi
+
 if [ "$GIT" = "yes" ]; then
     git add -- "$@"
     git commit --signoff -F - <<EOF
-- 
2.1.4

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

* [Qemu-devel] [PULL 22/23] clean-up: removed duplicate #includes
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (20 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 21/23] scripts/clean-includes: added duplicate #include check Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-28 15:18 ` [Qemu-devel] [PULL 23/23] Fix build for less common build directories names Michael Tokarev
  2016-10-31 12:35 ` [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Peter Maydell
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anand J, qemu-trivial, Michael Tokarev

From: Anand J <anand.indukala@gmail.com>

Some files contain multiple #includes of the same header file.
Removed most of those unnecessary duplicate entries using
scripts/clean-includes.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Anand J <anand.indukala@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 accel.c                             | 1 -
 cputlb.c                            | 1 -
 gdbstub.c                           | 1 -
 hw/i386/acpi-build.c                | 1 -
 hw/microblaze/boot.c                | 1 -
 hw/mips/mips_malta.c                | 1 -
 hw/nvram/fw_cfg.c                   | 1 -
 hw/pci-bridge/pci_expander_bridge.c | 1 -
 hw/ppc/ppc405_boards.c              | 1 -
 hw/ppc/spapr.c                      | 1 -
 hw/timer/grlib_gptimer.c            | 1 -
 hw/tpm/tpm_tis.c                    | 1 -
 hw/unicore32/puv3.c                 | 1 -
 hw/usb/dev-mtp.c                    | 1 -
 include/hw/i386/pc.h                | 1 -
 monitor.c                           | 2 --
 qemu-io-cmds.c                      | 1 -
 qmp.c                               | 1 -
 target-i386/machine.c               | 3 ---
 target-mips/machine.c               | 1 -
 target-ppc/machine.c                | 1 -
 target-ppc/mem_helper.c             | 1 -
 target-sparc/machine.c              | 3 ---
 target-xtensa/translate.c           | 1 -
 tests/crypto-tls-x509-helpers.h     | 3 ---
 tests/vhost-user-test.c             | 2 --
 util/oslib-posix.c                  | 1 -
 vl.c                                | 1 -
 28 files changed, 36 deletions(-)

diff --git a/accel.c b/accel.c
index 403eb5e..664bb88 100644
--- a/accel.c
+++ b/accel.c
@@ -33,7 +33,6 @@
 #include "sysemu/qtest.h"
 #include "hw/xen/xen.h"
 #include "qom/object.h"
-#include "hw/boards.h"
 
 int tcg_tb_size;
 static bool tcg_allowed = true;
diff --git a/cputlb.c b/cputlb.c
index cc4da4d..813279f 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -26,7 +26,6 @@
 #include "exec/cputlb.h"
 #include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
-#include "exec/exec-all.h"
 #include "tcg/tcg.h"
 #include "qemu/error-report.h"
 #include "exec/log.h"
diff --git a/gdbstub.c b/gdbstub.c
index b2e1b79..de62d26 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -31,7 +31,6 @@
 
 #define MAX_PACKET_LENGTH 4096
 
-#include "cpu.h"
 #include "qemu/sockets.h"
 #include "sysemu/kvm.h"
 #include "exec/semihost.h"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 93be96f..5cd1da9 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -53,7 +53,6 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci-host/q35.h"
 #include "hw/i386/x86-iommu.h"
-#include "hw/timer/hpet.h"
 
 #include "hw/acpi/aml-build.h"
 
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 9eebb1a..1834d22 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -30,7 +30,6 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-#include "qemu-common.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index cf9bd3e..cf48f42 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -47,7 +47,6 @@
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
-#include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "hw/sysbus.h"             /* SysBusDevice */
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 92aa563..1f0c3e9 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -29,7 +29,6 @@
 #include "hw/isa/isa.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
-#include "hw/boards.h"
 #include "trace.h"
 #include "qemu/error-report.h"
 #include "qemu/config-file.h"
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index 1cc598f..6ac187f 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -15,7 +15,6 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
-#include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/i386/pc.h"
 #include "qemu/range.h"
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 4b2f07a..d01798f 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -37,7 +37,6 @@
 #include "qemu/log.h"
 #include "qemu/error-report.h"
 #include "hw/loader.h"
-#include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 486f57d..17d5d6d 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -37,7 +37,6 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/cpus.h"
 #include "sysemu/kvm.h"
-#include "sysemu/device_tree.h"
 #include "kvm_ppc.h"
 #include "migration/migration.h"
 #include "mmu-hash64.h"
diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c
index 712d1ae..4ed96e9 100644
--- a/hw/timer/grlib_gptimer.c
+++ b/hw/timer/grlib_gptimer.c
@@ -26,7 +26,6 @@
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
-#include "qemu/timer.h"
 #include "qemu/main-loop.h"
 
 #include "trace.h"
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 381e726..a6440fe 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -34,7 +34,6 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
-#include "sysemu/tpm_backend.h"
 
 #define DEBUG_TIS 0
 
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 31cd171..032078f 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -13,7 +13,6 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "elf.h"
 #include "exec/address-spaces.h"
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 58d95ff..9cb0f50 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -17,7 +17,6 @@
 #include <sys/statvfs.h>
 #ifdef CONFIG_INOTIFY1
 #include <sys/inotify.h>
-#include "qapi/error.h"
 #include "qemu/main-loop.h"
 #endif
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 17fff80..98dc772 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -13,7 +13,6 @@
 #include "qemu/bitmap.h"
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
-#include "hw/boards.h"
 #include "hw/compat.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/nvdimm.h"
diff --git a/monitor.c b/monitor.c
index c4b6e26..7b963ad 100644
--- a/monitor.c
+++ b/monitor.c
@@ -59,7 +59,6 @@
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/json-parser.h"
 #include "qom/object_interfaces.h"
-#include "cpu.h"
 #include "trace.h"
 #include "trace/control.h"
 #include "monitor/hmp-target.h"
@@ -76,7 +75,6 @@
 #include "qapi/qmp-event.h"
 #include "qapi-event.h"
 #include "qmp-introspect.h"
-#include "sysemu/block-backend.h"
 #include "sysemu/qtest.h"
 #include "qemu/cutils.h"
 #include "qapi/qmp/dispatch.h"
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 3a3838a..e0249e2 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -18,7 +18,6 @@
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 #include "qemu/timer.h"
-#include "sysemu/block-backend.h"
 #include "qemu/cutils.h"
 
 #define CMD_NOFILE_OK   0x01
diff --git a/qmp.c b/qmp.c
index a06cb7b..0028f0b 100644
--- a/qmp.c
+++ b/qmp.c
@@ -36,7 +36,6 @@
 #include "qom/object_interfaces.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/acpi/acpi_dev_interface.h"
-#include "qemu/uuid.h"
 
 NameInfo *qmp_query_name(Error **errp)
 {
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 71c0e4d..48037f1 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -7,10 +7,7 @@
 #include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "migration/cpu.h"
-#include "exec/exec-all.h"
 
-#include "cpu.h"
-#include "exec/exec-all.h"
 #include "sysemu/kvm.h"
 
 #include "qemu/error-report.h"
diff --git a/target-mips/machine.c b/target-mips/machine.c
index a27f2f1..d20d948 100644
--- a/target-mips/machine.c
+++ b/target-mips/machine.c
@@ -2,7 +2,6 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
-#include "cpu.h"
 #include "migration/cpu.h"
 
 static int cpu_post_load(void *opaque, int version_id)
diff --git a/target-ppc/machine.c b/target-ppc/machine.c
index 4820f22..e43cb6c 100644
--- a/target-ppc/machine.c
+++ b/target-ppc/machine.c
@@ -8,7 +8,6 @@
 #include "helper_regs.h"
 #include "mmu-hash64.h"
 #include "migration/cpu.h"
-#include "exec/exec-all.h"
 
 static int cpu_load_old(QEMUFile *f, void *opaque, int version_id)
 {
diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c
index 6548715..1ab8a6e 100644
--- a/target-ppc/mem_helper.c
+++ b/target-ppc/mem_helper.c
@@ -23,7 +23,6 @@
 #include "exec/helper-proto.h"
 
 #include "helper_regs.h"
-#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 
 //#define DEBUG_OP
diff --git a/target-sparc/machine.c b/target-sparc/machine.c
index 59c92f7..aea6397 100644
--- a/target-sparc/machine.c
+++ b/target-sparc/machine.c
@@ -6,10 +6,7 @@
 #include "hw/boards.h"
 #include "qemu/timer.h"
 
-#include "cpu.h"
-#include "exec/exec-all.h"
 #include "migration/cpu.h"
-#include "exec/exec-all.h"
 
 #ifdef TARGET_SPARC64
 static const VMStateDescription vmstate_cpu_timer = {
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 4c1e487..fb0fa56 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -36,7 +36,6 @@
 #include "tcg-op.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
-#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/semihost.h"
 
diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helpers.h
index a8faa92..921341c 100644
--- a/tests/crypto-tls-x509-helpers.h
+++ b/tests/crypto-tls-x509-helpers.h
@@ -21,9 +21,6 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-
 #if !(defined WIN32) && \
     defined(CONFIG_TASN1) && \
     (LIBGNUTLS_VERSION_NUMBER >= 0x020600)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index a7f0629..8b10afb 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -22,8 +22,6 @@
 #include "libqos/virtio-pci.h"
 #include "qapi/error.h"
 
-#include "libqos/pci-pc.h"
-#include "libqos/virtio-pci.h"
 #include "libqos/malloc-pc.h"
 #include "hw/virtio/virtio-net.h"
 
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 8ec99cc..67c6589 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -28,7 +28,6 @@
 
 #include "qemu/osdep.h"
 #include <termios.h>
-#include <termios.h>
 
 #include <glib/gprintf.h>
 
diff --git a/vl.c b/vl.c
index 496e655..55763f7 100644
--- a/vl.c
+++ b/vl.c
@@ -110,7 +110,6 @@ int main(int argc, char **argv)
 #include "trace.h"
 #include "trace/control.h"
 #include "qemu/queue.h"
-#include "sysemu/cpus.h"
 #include "sysemu/arch_init.h"
 
 #include "ui/qemu-spice.h"
-- 
2.1.4

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

* [Qemu-devel] [PULL 23/23] Fix build for less common build directories names
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (21 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 22/23] clean-up: removed duplicate #includes Michael Tokarev
@ 2016-10-28 15:18 ` Michael Tokarev
  2016-10-31 12:35 ` [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Peter Maydell
  23 siblings, 0 replies; 25+ messages in thread
From: Michael Tokarev @ 2016-10-28 15:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, qemu-trivial, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

scripts/tracetool generates a C preprocessor macro from the name of the
build directory. Any characters which are possible in a directory name
but not allowed in a macro name must be substituted, otherwise builds
will fail.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/tracetool.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index 629b259..fe9c9e9 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -70,7 +70,7 @@ def make_group_name(filename):
 
     if dirname == "":
         return "common"
-    return re.sub(r"/|-", "_", dirname)
+    return re.sub(r"[^A-Za-z0-9]", "_", dirname)
 
 def main(args):
     global _SCRIPT
-- 
2.1.4

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

* Re: [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28
  2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
                   ` (22 preceding siblings ...)
  2016-10-28 15:18 ` [Qemu-devel] [PULL 23/23] Fix build for less common build directories names Michael Tokarev
@ 2016-10-31 12:35 ` Peter Maydell
  23 siblings, 0 replies; 25+ messages in thread
From: Peter Maydell @ 2016-10-31 12:35 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: QEMU Developers, QEMU Trivial

On 28 October 2016 at 16:18, Michael Tokarev <mjt@tls.msk.ru> wrote:
> Here's a next pull request for the trivial patches tree.
> Nothing exciting is in there this time, small things
> here and there.
>
> Thanks,
>
> /mjt
>
> The following changes since commit fd209e4a773dd5a7fea79eaaffd276ebcb99e92a:
>
>   Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging (2016-10-28 14:29:50 +0100)
>
> are available in the git repository at:
>
>   git://git.corpit.ru/qemu.git tags/trivial-patches-fetch
>
> for you to fetch changes up to 630b210b9abbf362905a2096c22c5eb1d6224e77:
>
>   Fix build for less common build directories names (2016-10-28 18:17:24 +0300)
>
> ----------------------------------------------------------------
> trivial patches for 2016-10-28
>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2016-10-31 12:35 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 15:18 [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 01/23] filter-dump: add missing "[" Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 02/23] hw/tpm/tpm_passthrough: Simplify if-statements a little bit Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 03/23] target-lm32: fix style issue Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 04/23] target-lm32: fix LOG_DIS operand order Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 05/23] target-lm32: swap operand of wcsr in LOG_DIS() Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 06/23] target-lm32: disable asm logging via LOG_DIS() Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 07/23] lm32: milkymist-tmu2: fix integer overflow Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 08/23] target-lm32: rewrite gen_compare() Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 09/23] hw/block/nvme: Simplify if-statements a little bit Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 10/23] milkymist-pfpu: fix potential integer overflow Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 11/23] colo-compare: remove unused struct CompareChardevProps and 'props' variable Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 12/23] MAINTAINERS: qemu-trivial information Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 13/23] usb: Change *_exitfn return type from int to void Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 14/23] qemu-options.hx: set: fix copy-paste error Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 15/23] scripts/hxtool: fix undefined behavour of echo Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 16/23] migration: Remove unneeded NULL check from migrate_fd_error() Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 17/23] s390: avoid always-true comparison in s390_pci_generate_fid() Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 18/23] Makefile: Fix help text for target 'installer' Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 19/23] qemu-ga: Remove stray 'q' in documentation Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 20/23] monitor: deprecate 'default' option Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 21/23] scripts/clean-includes: added duplicate #include check Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 22/23] clean-up: removed duplicate #includes Michael Tokarev
2016-10-28 15:18 ` [Qemu-devel] [PULL 23/23] Fix build for less common build directories names Michael Tokarev
2016-10-31 12:35 ` [Qemu-devel] [PULL 00/23] Trivial patches for 2016-10-28 Peter Maydell

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.