All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19
@ 2015-03-19  9:05 Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 01/24] cris: remove unused cris_cond15 declarations Michael Tokarev
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

Here's another trivial-patches pull request, it comes very close to
the release because I was too busy last 2 weeks to do anything useful
with the trivial-patches queue, and because it accumulated quite a few
patches since that.

Here, there are many code defects fixes found by coverity and sparse,
mostly from Stefan Weil, and also from Gonglei and Shannon Zhao.  There
are a few other bits and pieces, all look quite harmless.  And a few
more interesting changes:

 - smbios: add max speed comdline option for type-17 (meory device) structure
   by Gabriel L. Somlo

 - configure: enable kvm on x32 by Michael Tokarev

 - error: Replace error_report() & error_free() with error_report_err()
   by zhanghailiang

These aren't completely trivial, but again, should not have much impact,
and has been in the queue for quite some time too.

Please consider applying.

I omited a few other patches sent to -trivial for now, partly to speed up
processing of other patches, partly because some patches better wait for
2.4, and partly because some patches, in my opinion, needs one or another
work.  I'll post comments about these as replies to individual patches
posted.

Thanks,

/mjt

The following changes since commit cd232acfa0d70002fed89e9293f04afda577a513:

  Update version for v2.3.0-rc0 release (2015-03-17 18:58:33 +0000)

are available in the git repository at:

  git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2015-03-19

for you to fetch changes up to 8ce1ee4618f4a557959f5a5731f6726b30416df5:

  qga/commands-posix: Fix resource leak (2015-03-19 11:39:18 +0300)

----------------------------------------------------------------
trivial patches for 2015-03-19

----------------------------------------------------------------
Gabriel L. Somlo (1):
      smbios: add max speed comdline option for type-17 (meory device) structure

Gonglei (1):
      arm: fix memory leak

John Snow (1):
      qtest/ahci: Fix a bit mask expression

Markus Armbruster (3):
      hmp: Fix definition of command quit
      qmp: Drop unused .user_print from command definitions
      hmp: Fix texinfo documentation

Michael Tokarev (2):
      cris: remove unused cris_cond15 declarations
      configure: enable kvm on x32

Paolo Bonzini (1):
      vl: fix resource leak with monitor_fdset_add_fd

Paulo Vital (1):
      pc-dimm: Add description for device list.

Shannon Zhao (1):
      qga/commands-posix: Fix resource leak

Stefan Weil (11):
      backends: Fix warning from Sparse
      9pfs: Fix warnings from Sparse
      omap: Fix warnings from Sparse
      arm/nseries: Fix warnings from Sparse
      target-mips: Fix warning from Sparse
      qom: Fix warning from Sparse
      Fix remaining warnings from Sparse (void return)
      block/qapi: Fix Sparse warning
      target-moxie: Fix warnings from Sparse (one-bit signed bitfield)
      elf-loader: Fix truncation warning from coverity
      elf-loader: Add missing error handling for call of lseek

Viswesh (1):
      Fix typos in comments

zhanghailiang (1):
      error: Replace error_report() & error_free() with error_report_err()

 backends/tpm.c              |  2 +-
 block/qapi.c                |  2 +-
 configure                   |  4 ++-
 disas/cris.c                | 13 +--------
 fsdev/virtfs-proxy-helper.c |  2 +-
 hmp-commands.hx             | 42 +++++++++++------------------
 hw/9pfs/virtio-9p-handle.c  |  4 +--
 hw/9pfs/virtio-9p-local.c   |  4 +--
 hw/9pfs/virtio-9p-proxy.c   |  4 +--
 hw/9pfs/virtio-9p.c         |  3 ++-
 hw/arm/digic_boards.c       |  1 +
 hw/arm/highbank.c           |  1 +
 hw/arm/nseries.c            |  4 +--
 hw/arm/omap1.c              | 65 ++++++++++++++++++++++++++++++---------------
 hw/arm/omap2.c              | 12 ++++++---
 hw/arm/vexpress.c           |  3 ++-
 hw/arm/virt.c               |  5 ++--
 hw/char/omap_uart.c         |  3 ++-
 hw/core/loader.c            |  2 +-
 hw/display/omap_dss.c       | 15 +++++++----
 hw/display/vga.c            |  2 +-
 hw/dma/omap_dma.c           |  8 +++---
 hw/gpio/omap_gpio.c         |  3 ++-
 hw/i386/smbios.c            | 10 +++++--
 hw/intc/arm_gic.c           |  3 ++-
 hw/intc/etraxfs_pic.c       |  8 +++---
 hw/mem/pc-dimm.c            |  1 +
 hw/misc/omap_gpmc.c         |  3 ++-
 hw/misc/omap_l4.c           |  3 ++-
 hw/misc/omap_sdrc.c         |  3 ++-
 hw/misc/omap_tap.c          |  3 ++-
 hw/nvram/fw_cfg.c           |  2 +-
 hw/sd/omap_mmc.c            |  3 ++-
 hw/ssi/omap_spi.c           |  3 ++-
 hw/timer/a9gtimer.c         |  2 +-
 hw/timer/omap_gptimer.c     |  2 +-
 hw/tpm/tpm_tis.c            |  2 +-
 hw/usb/hcd-musb.c           | 20 +++++++-------
 include/hw/elf_ops.h        |  4 ++-
 include/qom/cpu.h           |  2 +-
 monitor.c                   |  8 +++---
 qemu-options.hx             |  4 +--
 qga/commands-posix.c        |  1 +
 qmp-commands.hx             |  4 ---
 qom/cpu.c                   |  2 +-
 savevm.c                    |  3 +--
 target-cris/opcode-cris.h   | 10 -------
 target-mips/dsp_helper.c    |  2 +-
 target-moxie/mmu.h          | 10 +++----
 target-tricore/translate.c  | 22 +++++++--------
 tests/ahci-test.c           |  2 +-
 vl.c                        |  6 +++--
 52 files changed, 191 insertions(+), 161 deletions(-)

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

* [Qemu-devel] [PULL 01/24] cris: remove unused cris_cond15 declarations
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 02/24] backends: Fix warning from Sparse Michael Tokarev
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
---
 disas/cris.c              | 13 +------------
 target-cris/opcode-cris.h | 10 ----------
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/disas/cris.c b/disas/cris.c
index 9dfb4e3..e6cff7a 100644
--- a/disas/cris.c
+++ b/disas/cris.c
@@ -1210,21 +1210,10 @@ cris_cc_strings[] =
   "le",
   "a",
   /* This is a placeholder.  In v0, this would be "ext".  In v32, this
-     is "sb".  See cris_conds15.  */
+     is "sb". */
   "wf"
 };
 
-/* Different names and semantics for condition 1111 (0xf).  */
-const struct cris_cond15 cris_cond15s[] =
-{
-  /* FIXME: In what version did condition "ext" disappear?  */
-  {"ext", cris_ver_v0_3},
-  {"wf", cris_ver_v10},
-  {"sb", cris_ver_v32p},
-  {NULL, 0}
-};
-
-
 /*
  * Local variables:
  * eval: (c-set-style "gnu")
diff --git a/target-cris/opcode-cris.h b/target-cris/opcode-cris.h
index 779d4aa..e7ebb98 100644
--- a/target-cris/opcode-cris.h
+++ b/target-cris/opcode-cris.h
@@ -108,16 +108,6 @@ struct cris_support_reg
 };
 extern const struct cris_support_reg cris_support_regs[];
 
-struct cris_cond15
-{
-  /* The name of the condition.  */
-  const char *const name;
-
-  /* What CPU version this condition name applies to.  */
-  enum cris_insn_version_usage applicable_version;
-};
-extern const struct cris_cond15 cris_conds15[];
-
 /* Opcode-dependent constants.  */
 #define AUTOINCR_BIT (0x04)
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 02/24] backends: Fix warning from Sparse
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 01/24] cris: remove unused cris_cond15 declarations Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 03/24] 9pfs: Fix warnings " Michael Tokarev
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

backends/tpm.c:39:5: warning: returning void-valued expression

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

diff --git a/backends/tpm.c b/backends/tpm.c
index 01860c4..4efe367 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -36,7 +36,7 @@ void tpm_backend_destroy(TPMBackend *s)
 {
     TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
 
-    return k->ops->destroy(s);
+    k->ops->destroy(s);
 }
 
 int tpm_backend_init(TPMBackend *s, TPMState *state,
-- 
2.1.4

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

* [Qemu-devel] [PULL 03/24] 9pfs: Fix warnings from Sparse
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 01/24] cris: remove unused cris_cond15 declarations Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 02/24] backends: Fix warning from Sparse Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 04/24] omap: " Michael Tokarev
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev, Michael S. Tsirkin

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

9pfs/virtio-9p.c:1953:9: warning: returning void-valued expression
9pfs/virtio-9p-handle.c:143:5: warning: returning void-valued expression
9pfs/virtio-9p-handle.c:160:5: warning: returning void-valued expression
9pfs/virtio-9p-local.c:384:5: warning: returning void-valued expression
9pfs/virtio-9p-local.c:415:5: warning: returning void-valued expression
9pfs/virtio-9p-proxy.c:672:5: warning: returning void-valued expression
9pfs/virtio-9p-proxy.c:689:5: warning: returning void-valued expression

Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/9pfs/virtio-9p-handle.c | 4 ++--
 hw/9pfs/virtio-9p-local.c  | 4 ++--
 hw/9pfs/virtio-9p-proxy.c  | 4 ++--
 hw/9pfs/virtio-9p.c        | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c
index 4b79cef..13eabb9 100644
--- a/hw/9pfs/virtio-9p-handle.c
+++ b/hw/9pfs/virtio-9p-handle.c
@@ -140,7 +140,7 @@ static int handle_opendir(FsContext *ctx,
 
 static void handle_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)
 {
-    return rewinddir(fs->dir);
+    rewinddir(fs->dir);
 }
 
 static off_t handle_telldir(FsContext *ctx, V9fsFidOpenState *fs)
@@ -157,7 +157,7 @@ static int handle_readdir_r(FsContext *ctx, V9fsFidOpenState *fs,
 
 static void handle_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
 {
-    return seekdir(fs->dir, off);
+    seekdir(fs->dir, off);
 }
 
 static ssize_t handle_preadv(FsContext *ctx, V9fsFidOpenState *fs,
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index d6b1c0c..f1f2e25 100644
--- a/hw/9pfs/virtio-9p-local.c
+++ b/hw/9pfs/virtio-9p-local.c
@@ -378,7 +378,7 @@ static int local_opendir(FsContext *ctx,
 
 static void local_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)
 {
-    return rewinddir(fs->dir);
+    rewinddir(fs->dir);
 }
 
 static off_t local_telldir(FsContext *ctx, V9fsFidOpenState *fs)
@@ -409,7 +409,7 @@ again:
 
 static void local_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
 {
-    return seekdir(fs->dir, off);
+    seekdir(fs->dir, off);
 }
 
 static ssize_t local_preadv(FsContext *ctx, V9fsFidOpenState *fs,
diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c
index 71b6198..1bc7881 100644
--- a/hw/9pfs/virtio-9p-proxy.c
+++ b/hw/9pfs/virtio-9p-proxy.c
@@ -669,7 +669,7 @@ static int proxy_opendir(FsContext *ctx,
 
 static void proxy_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)
 {
-    return rewinddir(fs->dir);
+    rewinddir(fs->dir);
 }
 
 static off_t proxy_telldir(FsContext *ctx, V9fsFidOpenState *fs)
@@ -686,7 +686,7 @@ static int proxy_readdir_r(FsContext *ctx, V9fsFidOpenState *fs,
 
 static void proxy_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
 {
-    return seekdir(fs->dir, off);
+    seekdir(fs->dir, off);
 }
 
 static ssize_t proxy_preadv(FsContext *ctx, V9fsFidOpenState *fs,
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 5861a5b..4964da0 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -1950,7 +1950,8 @@ static void v9fs_write(void *opaque)
 
     err = pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &count);
     if (err < 0) {
-        return complete_pdu(s, pdu, err);
+        complete_pdu(s, pdu, err);
+        return;
     }
     offset += err;
     v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true);
-- 
2.1.4

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

* [Qemu-devel] [PULL 04/24] omap: Fix warnings from Sparse
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (2 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 03/24] 9pfs: Fix warnings " Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 05/24] arm/nseries: " Michael Tokarev
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev, Peter Maydell

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

arm/omap1.c:1015:9: warning: returning void-valued expression
arm/omap1.c:1084:9: warning: returning void-valued expression
arm/omap1.c:1178:9: warning: returning void-valued expression
arm/omap1.c:1287:9: warning: returning void-valued expression
arm/omap1.c:1382:9: warning: returning void-valued expression
arm/omap1.c:1650:9: warning: returning void-valued expression
arm/omap1.c:1778:9: warning: returning void-valued expression
arm/omap1.c:1985:9: warning: returning void-valued expression
arm/omap1.c:210:9: warning: returning void-valued expression
arm/omap1.c:2213:9: warning: returning void-valued expression
arm/omap1.c:2352:9: warning: returning void-valued expression
arm/omap1.c:2447:9: warning: returning void-valued expression
arm/omap1.c:2640:9: warning: returning void-valued expression
arm/omap1.c:317:9: warning: returning void-valued expression
arm/omap1.c:3413:13: warning: returning void-valued expression
arm/omap1.c:3414:13: warning: returning void-valued expression
arm/omap1.c:3415:14: warning: returning void-valued expression
arm/omap1.c:3589:9: warning: returning void-valued expression
arm/omap1.c:443:9: warning: returning void-valued expression
arm/omap1.c:588:9: warning: returning void-valued expression
arm/omap1.c:860:9: warning: returning void-valued expression
arm/omap2.c:1362:9: warning: returning void-valued expression
arm/omap2.c:450:9: warning: returning void-valued expression
arm/omap2.c:695:9: warning: returning void-valued expression
arm/omap2.c:760:9: warning: returning void-valued expression
hw/char/omap_uart.c:115:9: warning: returning void-valued expression
hw/display/omap_dss.c:1019:9: warning: returning void-valued expression
hw/display/omap_dss.c:215:9: warning: returning void-valued expression
hw/display/omap_dss.c:380:9: warning: returning void-valued expression
hw/display/omap_dss.c:739:9: warning: returning void-valued expression
hw/display/omap_dss.c:931:9: warning: returning void-valued expression
hw/dma/omap_dma.c:139:5: warning: returning void-valued expression
hw/dma/omap_dma.c:1505:9: warning: returning void-valued expression
hw/dma/omap_dma.c:1860:9: warning: returning void-valued expression
hw/gpio/omap_gpio.c:116:9: warning: returning void-valued expression
hw/misc/omap_gpmc.c:627:9: warning: returning void-valued expression
hw/misc/omap_l4.c:85:9: warning: returning void-valued expression
hw/misc/omap_sdrc.c:95:9: warning: returning void-valued expression
hw/misc/omap_tap.c:98:9: warning: returning void-valued expression
hw/sd/omap_mmc.c:409:9: warning: returning void-valued expression
hw/ssi/omap_spi.c:229:9: warning: returning void-valued expression
hw/timer/omap_gptimer.c:447:9: warning: returning void-valued expression

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/arm/omap1.c          | 65 +++++++++++++++++++++++++++++++++----------------
 hw/arm/omap2.c          | 12 ++++++---
 hw/char/omap_uart.c     |  3 ++-
 hw/display/omap_dss.c   | 15 ++++++++----
 hw/dma/omap_dma.c       |  8 +++---
 hw/gpio/omap_gpio.c     |  3 ++-
 hw/misc/omap_gpmc.c     |  3 ++-
 hw/misc/omap_l4.c       |  3 ++-
 hw/misc/omap_sdrc.c     |  3 ++-
 hw/misc/omap_tap.c      |  3 ++-
 hw/sd/omap_mmc.c        |  3 ++-
 hw/ssi/omap_spi.c       |  3 ++-
 hw/timer/omap_gptimer.c |  2 +-
 13 files changed, 84 insertions(+), 42 deletions(-)

diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index abb183c..0615044 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -207,7 +207,8 @@ static void omap_mpu_timer_write(void *opaque, hwaddr addr,
     struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -314,7 +315,8 @@ static void omap_wd_timer_write(void *opaque, hwaddr addr,
     struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -440,7 +442,8 @@ static void omap_os_timer_write(void *opaque, hwaddr addr,
     int offset = addr & OMAP_MPUI_REG_MASK;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
@@ -585,7 +588,8 @@ static void omap_ulpd_pm_write(void *opaque, hwaddr addr,
     uint16_t diff;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -857,7 +861,8 @@ static void omap_pin_cfg_write(void *opaque, hwaddr addr,
     uint32_t diff;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1012,7 +1017,8 @@ static void omap_id_write(void *opaque, hwaddr addr,
                           uint64_t value, unsigned size)
 {
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     OMAP_BAD_REG(addr);
@@ -1081,7 +1087,8 @@ static void omap_mpui_write(void *opaque, hwaddr addr,
     struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1175,7 +1182,8 @@ static void omap_tipb_bridge_write(void *opaque, hwaddr addr,
     struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque;
 
     if (size < 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1284,7 +1292,8 @@ static void omap_tcmi_write(void *opaque, hwaddr addr,
     struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1379,7 +1388,8 @@ static void omap_dpll_write(void *opaque, hwaddr addr,
     int div, mult;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     if (addr == 0x00) {	/* CTL_REG */
@@ -1647,7 +1657,8 @@ static void omap_clkm_write(void *opaque, hwaddr addr,
     };
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1775,7 +1786,8 @@ static void omap_clkdsp_write(void *opaque, hwaddr addr,
     uint16_t diff;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1982,7 +1994,8 @@ static void omap_mpuio_write(void *opaque, hwaddr addr,
     int ln;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
@@ -2210,7 +2223,8 @@ static void omap_uwire_write(void *opaque, hwaddr addr,
     int offset = addr & OMAP_MPUI_REG_MASK;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
@@ -2349,7 +2363,8 @@ static void omap_pwl_write(void *opaque, hwaddr addr,
     int offset = addr & OMAP_MPUI_REG_MASK;
 
     if (size != 1) {
-        return omap_badwidth_write8(opaque, addr, value);
+        omap_badwidth_write8(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
@@ -2444,7 +2459,8 @@ static void omap_pwt_write(void *opaque, hwaddr addr,
     int offset = addr & OMAP_MPUI_REG_MASK;
 
     if (size != 1) {
-        return omap_badwidth_write8(opaque, addr, value);
+        omap_badwidth_write8(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
@@ -2637,7 +2653,8 @@ static void omap_rtc_write(void *opaque, hwaddr addr,
     time_t ti[2];
 
     if (size != 1) {
-        return omap_badwidth_write8(opaque, addr, value);
+        omap_badwidth_write8(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
@@ -3410,9 +3427,14 @@ static void omap_mcbsp_write(void *opaque, hwaddr addr,
                              uint64_t value, unsigned size)
 {
     switch (size) {
-    case 2: return omap_mcbsp_writeh(opaque, addr, value);
-    case 4: return omap_mcbsp_writew(opaque, addr, value);
-    default: return omap_badwidth_write16(opaque, addr, value);
+    case 2:
+        omap_mcbsp_writeh(opaque, addr, value);
+        break;
+    case 4:
+        omap_mcbsp_writew(opaque, addr, value);
+        break;
+    default:
+        omap_badwidth_write16(opaque, addr, value);
     }
 }
 
@@ -3586,7 +3608,8 @@ static void omap_lpg_write(void *opaque, hwaddr addr,
     int offset = addr & OMAP_MPUI_REG_MASK;
 
     if (size != 1) {
-        return omap_badwidth_write8(opaque, addr, value);
+        omap_badwidth_write8(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index b083ebe..3239014 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -447,7 +447,8 @@ static void omap_eac_write(void *opaque, hwaddr addr,
     struct omap_eac_s *s = (struct omap_eac_s *) opaque;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -692,7 +693,8 @@ static void omap_sti_write(void *opaque, hwaddr addr,
     struct omap_sti_s *s = (struct omap_sti_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -757,7 +759,8 @@ static void omap_sti_fifo_write(void *opaque, hwaddr addr,
     uint8_t byte = value;
 
     if (size != 1) {
-        return omap_badwidth_write8(opaque, addr, size);
+        omap_badwidth_write8(opaque, addr, size);
+        return;
     }
 
     if (ch == STI_TRACE_CONTROL_CHANNEL) {
@@ -1359,7 +1362,8 @@ static void omap_prcm_write(void *opaque, hwaddr addr,
     struct omap_prcm_s *s = (struct omap_prcm_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c
index 0b91693..88f2094 100644
--- a/hw/char/omap_uart.c
+++ b/hw/char/omap_uart.c
@@ -112,7 +112,8 @@ static void omap_uart_write(void *opaque, hwaddr addr,
     struct omap_uart_s *s = (struct omap_uart_s *) opaque;
 
     if (size == 4) {
-        return omap_badwidth_write8(opaque, addr, value);
+        omap_badwidth_write8(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c
index 24ccbcc..f1fef27 100644
--- a/hw/display/omap_dss.c
+++ b/hw/display/omap_dss.c
@@ -212,7 +212,8 @@ static void omap_diss_write(void *opaque, hwaddr addr,
     struct omap_dss_s *s = (struct omap_dss_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -377,7 +378,8 @@ static void omap_disc_write(void *opaque, hwaddr addr,
     struct omap_dss_s *s = (struct omap_dss_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -736,7 +738,8 @@ static void omap_rfbi_write(void *opaque, hwaddr addr,
     struct omap_dss_s *s = (struct omap_dss_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -928,7 +931,8 @@ static void omap_venc_write(void *opaque, hwaddr addr,
                             uint64_t value, unsigned size)
 {
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, size);
+        omap_badwidth_write32(opaque, addr, size);
+        return;
     }
 
     switch (addr) {
@@ -1016,7 +1020,8 @@ static void omap_im3_write(void *opaque, hwaddr addr,
                            uint64_t value, unsigned size)
 {
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c
index 756a87a..97c57a0 100644
--- a/hw/dma/omap_dma.c
+++ b/hw/dma/omap_dma.c
@@ -136,7 +136,7 @@ struct omap_dma_s {
 
 static inline void omap_dma_interrupts_update(struct omap_dma_s *s)
 {
-    return s->intr_update(s);
+    s->intr_update(s);
 }
 
 static void omap_dma_channel_load(struct omap_dma_channel_s *ch)
@@ -1502,7 +1502,8 @@ static void omap_dma_write(void *opaque, hwaddr addr,
     int reg, ch;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
@@ -1857,7 +1858,8 @@ static void omap_dma4_write(void *opaque, hwaddr addr,
     struct omap_dma_channel_s *ch;
 
     if (size == 1) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
index 938782a..9a43486 100644
--- a/hw/gpio/omap_gpio.c
+++ b/hw/gpio/omap_gpio.c
@@ -113,7 +113,8 @@ static void omap_gpio_write(void *opaque, hwaddr addr,
     int ln;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, addr, value);
+        omap_badwidth_write16(opaque, addr, value);
+        return;
     }
 
     switch (offset) {
diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c
index a0de52f..74fc91c 100644
--- a/hw/misc/omap_gpmc.c
+++ b/hw/misc/omap_gpmc.c
@@ -624,7 +624,8 @@ static void omap_gpmc_write(void *opaque, hwaddr addr,
     struct omap_gpmc_cs_file_s *f;
 
     if (size != 4 && gpmc_wordaccess_only(addr)) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c
index f237250..245ceac 100644
--- a/hw/misc/omap_l4.c
+++ b/hw/misc/omap_l4.c
@@ -82,7 +82,8 @@ static void omap_l4ta_write(void *opaque, hwaddr addr,
     struct omap_target_agent_s *s = (struct omap_target_agent_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c
index ed62caf..3de0c0e 100644
--- a/hw/misc/omap_sdrc.c
+++ b/hw/misc/omap_sdrc.c
@@ -92,7 +92,8 @@ static void omap_sdrc_write(void *opaque, hwaddr addr,
     struct omap_sdrc_s *s = (struct omap_sdrc_s *) opaque;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/misc/omap_tap.c b/hw/misc/omap_tap.c
index 9d2b710..6f02bb9 100644
--- a/hw/misc/omap_tap.c
+++ b/hw/misc/omap_tap.c
@@ -95,7 +95,8 @@ static void omap_tap_write(void *opaque, hwaddr addr,
                            uint64_t value, unsigned size)
 {
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     OMAP_BAD_REG(addr);
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index 86c477d..d072dec 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -406,7 +406,8 @@ static void omap_mmc_write(void *opaque, hwaddr offset,
     struct omap_mmc_s *s = (struct omap_mmc_s *) opaque;
 
     if (size != 2) {
-        return omap_badwidth_write16(opaque, offset, value);
+        omap_badwidth_write16(opaque, offset, value);
+        return;
     }
 
     switch (offset) {
diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c
index 0ed3b11..119e325 100644
--- a/hw/ssi/omap_spi.c
+++ b/hw/ssi/omap_spi.c
@@ -226,7 +226,8 @@ static void omap_mcspi_write(void *opaque, hwaddr addr,
     int ch = 0;
 
     if (size != 4) {
-        return omap_badwidth_write32(opaque, addr, value);
+        omap_badwidth_write32(opaque, addr, value);
+        return;
     }
 
     switch (addr) {
diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c
index b7f3d49..b8c8c01 100644
--- a/hw/timer/omap_gptimer.c
+++ b/hw/timer/omap_gptimer.c
@@ -444,7 +444,7 @@ static void omap_gp_timer_writeh(void *opaque, hwaddr addr,
     struct omap_gp_timer_s *s = (struct omap_gp_timer_s *) opaque;
 
     if (addr & 2)
-        return omap_gp_timer_write(opaque, addr, (value << 16) | s->writeh);
+        omap_gp_timer_write(opaque, addr, (value << 16) | s->writeh);
     else
         s->writeh = (uint16_t) value;
 }
-- 
2.1.4

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

* [Qemu-devel] [PULL 05/24] arm/nseries: Fix warnings from Sparse
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (3 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 04/24] omap: " Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 06/24] target-mips: Fix warning " Michael Tokarev
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev, Peter Maydell

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

arm/nseries.c:1406:5: warning: returning void-valued expression
arm/nseries.c:1411:5: warning: returning void-valued expression

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/arm/nseries.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 4d7be5e..2a5406d 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -1403,12 +1403,12 @@ static struct arm_boot_info n810_binfo = {
 
 static void n800_init(MachineState *machine)
 {
-    return n8x0_init(machine, &n800_binfo, 800);
+    n8x0_init(machine, &n800_binfo, 800);
 }
 
 static void n810_init(MachineState *machine)
 {
-    return n8x0_init(machine, &n810_binfo, 810);
+    n8x0_init(machine, &n810_binfo, 810);
 }
 
 static QEMUMachine n800_machine = {
-- 
2.1.4

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

* [Qemu-devel] [PULL 06/24] target-mips: Fix warning from Sparse
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (4 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 05/24] arm/nseries: " Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 07/24] qom: " Michael Tokarev
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Stefan Weil, Michael Tokarev, Leon Alrae, Aurelien Jarno

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

target-mips/dsp_helper.c:3681:5: warning: returning void-valued expression

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-mips/dsp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c
index 349f2a0..46528de 100644
--- a/target-mips/dsp_helper.c
+++ b/target-mips/dsp_helper.c
@@ -3678,7 +3678,7 @@ void cpu_wrdsp(uint32_t rs, uint32_t mask_num, CPUMIPSState *env)
 
 void helper_wrdsp(target_ulong rs, target_ulong mask_num, CPUMIPSState *env)
 {
-    return cpu_wrdsp(rs, mask_num, env);
+    cpu_wrdsp(rs, mask_num, env);
 }
 
 uint32_t cpu_rddsp(uint32_t mask_num, CPUMIPSState *env)
-- 
2.1.4

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

* [Qemu-devel] [PULL 07/24] qom: Fix warning from Sparse
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (5 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 06/24] target-mips: Fix warning " Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 08/24] Fix remaining warnings from Sparse (void return) Michael Tokarev
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Stefan Weil, Michael Tokarev, Andreas Färber

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

qom/cpu.c:99:5: warning: returning void-valued expression

Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qom/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qom/cpu.c b/qom/cpu.c
index 970377e..108bfa2 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -96,7 +96,7 @@ void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
 
-    return cc->get_memory_mapping(cpu, list, errp);
+    cc->get_memory_mapping(cpu, list, errp);
 }
 
 static void cpu_common_get_memory_mapping(CPUState *cpu,
-- 
2.1.4

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

* [Qemu-devel] [PULL 08/24] Fix remaining warnings from Sparse (void return)
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (6 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 07/24] qom: " Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 09/24] block/qapi: Fix Sparse warning Michael Tokarev
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Stefan Weil, Michael Tokarev, Luiz Capitulino,
	Gerd Hoffmann, Edgar E. Iglesias, Andreas Färber

From: Stefan Weil <sw@weilnetz.de>

Sparse report:

hw/display/vga.c:2000:5: warning: returning void-valued expression
hw/intc/arm_gic.c:707:9: warning: returning void-valued expression
hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression
hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression
hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression
hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression
hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression
hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression
hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression
hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression
include/qom/cpu.h:584:5: warning: returning void-valued expression
monitor.c:4686:13: warning: returning void-valued expression
monitor.c:4690:13: warning: returning void-valued expression

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/display/vga.c      |  2 +-
 hw/intc/arm_gic.c     |  3 ++-
 hw/intc/etraxfs_pic.c |  8 +++++---
 hw/nvram/fw_cfg.c     |  2 +-
 hw/timer/a9gtimer.c   |  2 +-
 hw/tpm/tpm_tis.c      |  2 +-
 hw/usb/hcd-musb.c     | 20 +++++++++++---------
 include/qom/cpu.h     |  2 +-
 monitor.c             |  8 +++++---
 9 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/hw/display/vga.c b/hw/display/vga.c
index c0f7b34..d1d296c 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1997,7 +1997,7 @@ static void vga_mem_write(void *opaque, hwaddr addr,
 {
     VGACommonState *s = opaque;
 
-    return vga_mem_writeb(s, addr, data);
+    vga_mem_writeb(s, addr, data);
 }
 
 const MemoryRegionOps vga_mem_ops = {
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index 270ce05..a04c822 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -704,7 +704,8 @@ static void gic_cpu_write(GICState *s, int cpu, int offset, uint32_t value)
         s->bpr[cpu] = (value & 0x7);
         break;
     case 0x10: /* End Of Interrupt */
-        return gic_complete_irq(s, cpu, value & 0x3ff);
+        gic_complete_irq(s, cpu, value & 0x3ff);
+        return;
     case 0x1c: /* Aliased Binary Point */
         if (s->revision >= 2) {
             s->abpr[cpu] = (value & 0x7);
diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c
index 636262b..bd58868 100644
--- a/hw/intc/etraxfs_pic.c
+++ b/hw/intc/etraxfs_pic.c
@@ -131,11 +131,13 @@ static void nmi_handler(void *opaque, int irq, int level)
 }
 
 static void irq_handler(void *opaque, int irq, int level)
-{   
+{
     struct etrax_pic *fs = (void *)opaque;
 
-    if (irq >= 30)
-        return nmi_handler(opaque, irq, level);
+    if (irq >= 30) {
+        nmi_handler(opaque, irq, level);
+        return;
+    }
 
     irq -= 1;
     fs->regs[R_R_VECT] &= ~(1 << irq);
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 78a37be..4caf536 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -472,7 +472,7 @@ void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value)
 {
     size_t sz = strlen(value) + 1;
 
-    return fw_cfg_add_bytes(s, key, g_memdup(value, sz), sz);
+    fw_cfg_add_bytes(s, key, g_memdup(value, sz), sz);
 }
 
 void fw_cfg_add_i16(FWCfgState *s, uint16_t key, uint16_t value)
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index b087bbd..dd4aae8 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -121,7 +121,7 @@ static void a9_gtimer_update_no_sync(void *opaque)
 {
     A9GTimerState *s = A9_GTIMER(opaque);
 
-    return a9_gtimer_update(s, false);
+    a9_gtimer_update(s, false);
 }
 
 static uint64_t a9_gtimer_read(void *opaque, hwaddr addr, unsigned size)
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 9084ca4..815c8ea 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -868,7 +868,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
 static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
                                uint64_t val, unsigned size)
 {
-    return tpm_tis_mmio_write_intern(opaque, addr, val, size, false);
+    tpm_tis_mmio_write_intern(opaque, addr, val, size, false);
 }
 
 static const MemoryRegionOps tpm_tis_memory_ops = {
diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c
index 40809f6..61cc878 100644
--- a/hw/usb/hcd-musb.c
+++ b/hw/usb/hcd-musb.c
@@ -554,8 +554,10 @@ static void musb_schedule_cb(USBPort *port, USBPacket *packey)
         timeout = ep->timeout[dir];
     else if (ep->interrupt[dir])
         timeout = 8;
-    else
-        return musb_cb_tick(ep);
+    else {
+        musb_cb_tick(ep);
+        return;
+    }
 
     if (!ep->intv_timer[dir])
         ep->intv_timer[dir] = timer_new_ns(QEMU_CLOCK_VIRTUAL, musb_cb_tick, ep);
@@ -772,9 +774,11 @@ static void musb_rx_packet_complete(USBPacket *packey, void *opaque)
 
         /* NAK timeouts are only generated in Bulk transfers and
          * Data-errors in Isochronous.  */
-        if (ep->interrupt[1])
-            return musb_packet(s, ep, epnum, USB_TOKEN_IN,
-                            packey->iov.size, musb_rx_packet_complete, 1);
+        if (ep->interrupt[1]) {
+            musb_packet(s, ep, epnum, USB_TOKEN_IN,
+                        packey->iov.size, musb_rx_packet_complete, 1);
+            return;
+        }
 
         ep->csr[1] |= MGC_M_RXCSR_DATAERROR;
         if (!epnum)
@@ -864,8 +868,7 @@ static void musb_tx_rdy(MUSBState *s, int epnum)
          * but it doesn't make sense for us to do that.  */
     }
 
-    return musb_packet(s, ep, epnum, pid,
-                    total, musb_tx_packet_complete, 0);
+    musb_packet(s, ep, epnum, pid, total, musb_tx_packet_complete, 0);
 }
 
 static void musb_rx_req(MUSBState *s, int epnum)
@@ -929,8 +932,7 @@ static void musb_rx_req(MUSBState *s, int epnum)
     }
 #endif
 
-    return musb_packet(s, ep, epnum, USB_TOKEN_IN,
-                    total, musb_rx_packet_complete, 1);
+    musb_packet(s, ep, epnum, USB_TOKEN_IN, total, musb_rx_packet_complete, 1);
 }
 
 static uint8_t musb_read_fifo(MUSBEndPoint *ep)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index d6279c0..9dafb48 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -593,7 +593,7 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
 
-    return cc->do_unaligned_access(cpu, addr, is_write, is_user, retaddr);
+    cc->do_unaligned_access(cpu, addr, is_write, is_user, retaddr);
 }
 #endif
 
diff --git a/monitor.c b/monitor.c
index 42116a9..f7e4739 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4691,11 +4691,13 @@ static void monitor_find_completion_by_table(Monitor *mon,
 
         if (cmd->sub_table) {
             /* do the job again */
-            return monitor_find_completion_by_table(mon, cmd->sub_table,
-                                                    &args[1], nb_args - 1);
+            monitor_find_completion_by_table(mon, cmd->sub_table,
+                                             &args[1], nb_args - 1);
+            return;
         }
         if (cmd->command_completion) {
-            return cmd->command_completion(mon->rs, nb_args, args[nb_args - 1]);
+            cmd->command_completion(mon->rs, nb_args, args[nb_args - 1]);
+            return;
         }
 
         ptype = next_arg_type(cmd->args_type);
-- 
2.1.4

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

* [Qemu-devel] [PULL 09/24] block/qapi: Fix Sparse warning
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (7 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 08/24] Fix remaining warnings from Sparse (void return) Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 10/24] target-moxie: Fix warnings from Sparse (one-bit signed bitfield) Michael Tokarev
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

Sparse reports this warning:

block/qapi.c:417:47: warning:
 too long initializer-string for array of char(no space for nul char)

Replacing the string by an array of characters fixes this warning.

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

diff --git a/block/qapi.c b/block/qapi.c
index 1808e67..8a19aed 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -414,7 +414,7 @@ BlockStatsList *qmp_query_blockstats(bool has_query_nodes,
 
 static char *get_human_readable_size(char *buf, int buf_size, int64_t size)
 {
-    static const char suffixes[NB_SUFFIXES] = "KMGT";
+    static const char suffixes[NB_SUFFIXES] = {'K', 'M', 'G', 'T'};
     int64_t base;
     int i;
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 10/24] target-moxie: Fix warnings from Sparse (one-bit signed bitfield)
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (8 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 09/24] block/qapi: Fix Sparse warning Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 11/24] hmp: Fix definition of command quit Michael Tokarev
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Anthony Green, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

Report from Sparse:

target-moxie/mmu.h:9:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:10:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:11:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:12:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:13:12: error: dubious one-bit signed bitfield

Cc: Anthony Green <green@moxielogic.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-moxie/mmu.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/target-moxie/mmu.h b/target-moxie/mmu.h
index e01ffc2..abc7929 100644
--- a/target-moxie/mmu.h
+++ b/target-moxie/mmu.h
@@ -6,11 +6,11 @@
 typedef struct {
     uint32_t phy;
     uint32_t pfn;
-    int g:1;
-    int v:1;
-    int k:1;
-    int w:1;
-    int e:1;
+    unsigned g:1;
+    unsigned v:1;
+    unsigned k:1;
+    unsigned w:1;
+    unsigned e:1;
     int cause_op;
 } MoxieMMUResult;
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 11/24] hmp: Fix definition of command quit
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (9 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 10/24] target-moxie: Fix warnings from Sparse (one-bit signed bitfield) Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 12/24] qmp: Drop unused .user_print from command definitions Michael Tokarev
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster

From: Markus Armbruster <armbru@redhat.com>

The command handler is a union of two function types.  If
cmd->user_print is set, handle_user_command() calls
cmd->mhandler.cmd_new(), else cmd->mhandler.cmd().

Command definitions must therefore either set both user_print() and
mhandler.cmd_new(), or only mhandler.cmd().

quit's sets user_print and mhandler.cmd().  handle_user_command()
calls hmp_quit() through mhandler.cmd_new() rather than
mhandler.cmd(), i.e. through a function pointer with a different type.
Broken in commit 7a7f325, v1.0.

Works in practice because hmp_quit() doesn't use its arguments, and
handle_user_command() ignores its function value.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hmp-commands.hx | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index 328709d..6fd5336 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -47,7 +47,6 @@ ETEXI
         .args_type  = "",
         .params     = "",
         .help       = "quit the emulator",
-        .user_print = monitor_user_noop,
         .mhandler.cmd = hmp_quit,
     },
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 12/24] qmp: Drop unused .user_print from command definitions
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (10 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 11/24] hmp: Fix definition of command quit Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 13/24] arm: fix memory leak Michael Tokarev
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster

From: Markus Armbruster <armbru@redhat.com>

.user_print isn't used with QMP commands, only with HMP commands.
Copied over when QMP got its own command table in commit 82a56f0.
Most of them have been dropped since, but a few stragglers remain.
Drop them.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qmp-commands.hx | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/qmp-commands.hx b/qmp-commands.hx
index 0663924..87f0f01 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -276,7 +276,6 @@ EQMP
         .args_type  = "device:O",
         .params     = "driver[,prop=value][,...]",
         .help       = "add device, like -device on the command line",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_new = do_device_add,
     },
 
@@ -786,7 +785,6 @@ EQMP
         .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
         .params     = "protocol hostname port tls-port cert-subject",
         .help       = "send migration info to spice/vnc client",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_async = client_migrate_info,
         .flags      = MONITOR_CMD_ASYNC,
     },
@@ -822,7 +820,6 @@ EQMP
         .args_type  = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
         .params     = "-p protocol [begin] [length] [format]",
         .help       = "dump guest memory to file",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
     },
 
@@ -1862,7 +1859,6 @@ EQMP
         .args_type  = "",
         .params     = "",
         .help       = "enable QMP capabilities",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_new = do_qmp_capabilities,
     },
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 13/24] arm: fix memory leak
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (11 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 12/24] qmp: Drop unused .user_print from command definitions Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 14/24] error: Replace error_report() & error_free() with error_report_err() Michael Tokarev
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Gonglei, Michael Tokarev

From: Gonglei <arei.gonglei@huawei.com>

Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/arm/digic_boards.c | 1 +
 hw/arm/highbank.c     | 1 +
 hw/arm/vexpress.c     | 3 ++-
 hw/arm/virt.c         | 3 ++-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 7114c36..e576646 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -113,6 +113,7 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
             error_report("Couldn't load rom image '%s'.", filename);
             exit(1);
         }
+        g_free(fn);
     }
 }
 
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index a92cdc3..ddd10dc 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -282,6 +282,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
             if (load_image_targphys("sysram.bin", 0xfff88000, filesize) < 0) {
                 hw_error("Unable to load %s\n", bios_name);
             }
+            g_free(sysboot_filename);
         } else {
            hw_error("Unable to find %s\n", bios_name);
         }
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 8496c16..e9a7ced 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -562,7 +562,7 @@ static void vexpress_common_init(MachineState *machine)
      * If a bios file was provided, attempt to map it into memory
      */
     if (bios_name) {
-        const char *fn;
+        char *fn;
 
         if (drive_get(IF_PFLASH, 0, 0)) {
             error_report("The contents of the first flash device may be "
@@ -576,6 +576,7 @@ static void vexpress_common_init(MachineState *machine)
             error_report("Could not load ROM image '%s'", bios_name);
             exit(1);
         }
+        g_free(fn);
     }
 
     /* Motherboard peripherals: the wiring is the same but the
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9072bc2..b2eaea8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -552,7 +552,7 @@ static void create_flash(const VirtBoardInfo *vbi)
     char *nodename;
 
     if (bios_name) {
-        const char *fn;
+        char *fn;
 
         if (drive_get(IF_PFLASH, 0, 0)) {
             error_report("The contents of the first flash device may be "
@@ -565,6 +565,7 @@ static void create_flash(const VirtBoardInfo *vbi)
             error_report("Could not load ROM image '%s'", bios_name);
             exit(1);
         }
+        g_free(fn);
     }
 
     create_one_flash("virt.flash0", flashbase, flashsize);
-- 
2.1.4

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

* [Qemu-devel] [PULL 14/24] error: Replace error_report() & error_free() with error_report_err()
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (12 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 13/24] arm: fix memory leak Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 15/24] configure: enable kvm on x32 Michael Tokarev
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, zhanghailiang

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

This is a continuation of the work started in commit 565f65d27:
"error: Use error_report_err() where appropriate"

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/arm/virt.c | 2 +-
 savevm.c      | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index b2eaea8..b652b07 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -771,7 +771,7 @@ static void machvirt_init(MachineState *machine)
         cc->parse_features(CPU(cpuobj), cpuopts, &err);
         g_free(cpuopts);
         if (err) {
-            error_report("%s", error_get_pretty(err));
+            error_report_err(err);
             exit(1);
         }
 
diff --git a/savevm.c b/savevm.c
index e7d97ee..3b0e222 100644
--- a/savevm.c
+++ b/savevm.c
@@ -941,8 +941,7 @@ int qemu_loadvm_state(QEMUFile *f)
     int file_error_after_eof = -1;
 
     if (qemu_savevm_state_blocked(&local_err)) {
-        error_report("%s", error_get_pretty(local_err));
-        error_free(local_err);
+        error_report_err(local_err);
         return -EINVAL;
     }
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 15/24] configure: enable kvm on x32
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (13 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 14/24] error: Replace error_report() & error_free() with error_report_err() Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 16/24] pc-dimm: Add description for device list Michael Tokarev
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Adam Borowski, Michael Tokarev

Here's a trivial change to enable kvm on x32 architecture.
I'm not 100% sure the result works correctly in all cases,
but this is a good start and in theory everything should
work.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index f74a6fd..589798e 100755
--- a/configure
+++ b/configure
@@ -5268,7 +5268,9 @@ case "$target_name" in
       \( "$target_name" = "ppcemb" -a "$cpu" = "ppc64" \) -o \
       \( "$target_name" = "mipsel" -a "$cpu" = "mips" \) -o \
       \( "$target_name" = "x86_64" -a "$cpu" = "i386"   \) -o \
-      \( "$target_name" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
+      \( "$target_name" = "i386"   -a "$cpu" = "x86_64" \) -o \
+      \( "$target_name" = "x86_64" -a "$cpu" = "x32"   \) -o \
+      \( "$target_name" = "i386"   -a "$cpu" = "x32" \) \) ; then
       echo "CONFIG_KVM=y" >> $config_target_mak
       if test "$vhost_net" = "yes" ; then
         echo "CONFIG_VHOST_NET=y" >> $config_target_mak
-- 
2.1.4

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

* [Qemu-devel] [PULL 16/24] pc-dimm: Add description for device list.
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (14 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 15/24] configure: enable kvm on x32 Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 17/24] smbios: add max speed comdline option for type-17 (meory device) structure Michael Tokarev
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Paulo Vital

From: Paulo Vital <paulo.vital@profitbricks.com>

The pc-dimm option presented on device list (by argument "-device \?")
is the unique option that don't have any information about it. This
patch adds a description for the pc-dimm device to help users to
identify it.

Signed-off-by: Paulo Vital <paulo.vital@profitbricks.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/mem/pc-dimm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index de81b9c..39f0c97 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -351,6 +351,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data)
 
     dc->realize = pc_dimm_realize;
     dc->props = pc_dimm_properties;
+    dc->desc = "DIMM memory module";
 
     ddc->get_memory_region = pc_dimm_get_memory_region;
 }
-- 
2.1.4

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

* [Qemu-devel] [PULL 17/24] smbios: add max speed comdline option for type-17 (meory device) structure
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (15 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 16/24] pc-dimm: Add description for device list Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 18/24] vl: fix resource leak with monitor_fdset_add_fd Michael Tokarev
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Gabriel L. Somlo, Michael Tokarev, Gabriel Somlo

From: "Gabriel L. Somlo" <gsomlo@gmail.com>

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/i386/smbios.c | 10 ++++++++--
 qemu-options.hx  |  4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index f2e9ab6..1341e02 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -91,6 +91,7 @@ static struct {
 
 static struct {
     const char *loc_pfx, *bank, *manufacturer, *serial, *asset, *part;
+    uint16_t speed;
 } type17;
 
 static QemuOptsList qemu_smbios_opts = {
@@ -304,6 +305,10 @@ static const QemuOptDesc qemu_smbios_type17_opts[] = {
         .name = "part",
         .type = QEMU_OPT_STRING,
         .help = "part number",
+    },{
+        .name = "speed",
+        .type = QEMU_OPT_NUMBER,
+        .help = "maximum capable speed",
     },
     { /* end of list */ }
 };
@@ -697,13 +702,13 @@ static void smbios_build_type_17_table(unsigned instance, uint64_t size)
     SMBIOS_TABLE_SET_STR(17, bank_locator_str, type17.bank);
     t->memory_type = 0x07; /* RAM */
     t->type_detail = cpu_to_le16(0x02); /* Other */
-    t->speed = cpu_to_le16(0); /* Unknown */
+    t->speed = cpu_to_le16(type17.speed);
     SMBIOS_TABLE_SET_STR(17, manufacturer_str, type17.manufacturer);
     SMBIOS_TABLE_SET_STR(17, serial_number_str, type17.serial);
     SMBIOS_TABLE_SET_STR(17, asset_tag_number_str, type17.asset);
     SMBIOS_TABLE_SET_STR(17, part_number_str, type17.part);
     t->attributes = 0; /* Unknown */
-    t->configured_clock_speed = cpu_to_le16(0); /* Unknown */
+    t->configured_clock_speed = t->speed; /* reuse value for max speed */
     t->minimum_voltage = cpu_to_le16(0); /* Unknown */
     t->maximum_voltage = cpu_to_le16(0); /* Unknown */
     t->configured_voltage = cpu_to_le16(0); /* Unknown */
@@ -1083,6 +1088,7 @@ void smbios_entry_add(QemuOpts *opts)
             save_opt(&type17.serial, opts, "serial");
             save_opt(&type17.asset, opts, "asset");
             save_opt(&type17.part, opts, "part");
+            type17.speed = qemu_opt_get_number(opts, "speed", 0);
             return;
         default:
             error_report("Don't know how to build fields for SMBIOS type %ld",
diff --git a/qemu-options.hx b/qemu-options.hx
index c513352..16ff72c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1403,7 +1403,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
     "              [,asset=str][,part=str]\n"
     "                specify SMBIOS type 4 fields\n"
     "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
-    "               [,asset=str][,part=str]\n"
+    "               [,asset=str][,part=str][,speed=%d]\n"
     "                specify SMBIOS type 17 fields\n",
     QEMU_ARCH_I386)
 STEXI
@@ -1426,7 +1426,7 @@ Specify SMBIOS type 3 fields
 @item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
 Specify SMBIOS type 4 fields
 
-@item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
+@item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}][,speed=@var{%d}]
 Specify SMBIOS type 17 fields
 ETEXI
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 18/24] vl: fix resource leak with monitor_fdset_add_fd
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (16 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 17/24] smbios: add max speed comdline option for type-17 (meory device) structure Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 19/24] qtest/ahci: Fix a bit mask expression Michael Tokarev
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP
command add_fd).  Free it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 vl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 694deb4..69617d6 100644
--- a/vl.c
+++ b/vl.c
@@ -1012,6 +1012,7 @@ static int parse_add_fd(QemuOpts *opts, void *opaque)
     int fd, dupfd, flags;
     int64_t fdset_id;
     const char *fd_opaque = NULL;
+    AddfdInfo *fdinfo;
 
     fd = qemu_opt_get_number(opts, "fd", -1);
     fdset_id = qemu_opt_get_number(opts, "set", -1);
@@ -1061,8 +1062,9 @@ static int parse_add_fd(QemuOpts *opts, void *opaque)
     }
 
     /* add the duplicate fd, and optionally the opaque string, to the fd set */
-    monitor_fdset_add_fd(dupfd, true, fdset_id, fd_opaque ? true : false,
-                         fd_opaque, NULL);
+    fdinfo = monitor_fdset_add_fd(dupfd, true, fdset_id, !!fd_opaque, fd_opaque,
+                                  &error_abort);
+    g_free(fdinfo);
 
     return 0;
 }
-- 
2.1.4

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

* [Qemu-devel] [PULL 19/24] qtest/ahci: Fix a bit mask expression
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (17 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 18/24] vl: fix resource leak with monitor_fdset_add_fd Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 20/24] Fix typos in comments Michael Tokarev
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, John Snow

From: John Snow <jsnow@redhat.com>

A thinko that clang 3.5.0 caught.
Thankfully does not introduce any new failures.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 tests/ahci-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index cf0b98b..169e83b 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -583,7 +583,7 @@ static void ahci_test_port_spec(AHCIQState *ahci, uint8_t port)
         ASSERT_BIT_CLEAR(reg, AHCI_PX_CMD_MPSP);
     }
     /* If, via CPD or MPSP we detect a drive, HPCP must be on. */
-    if (BITANY(reg, AHCI_PX_CMD_CPD || AHCI_PX_CMD_MPSP)) {
+    if (BITANY(reg, AHCI_PX_CMD_CPD | AHCI_PX_CMD_MPSP)) {
         ASSERT_BIT_SET(reg, AHCI_PX_CMD_HPCP);
     }
     /* HPCP and ESP cannot both be active. */
-- 
2.1.4

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

* [Qemu-devel] [PULL 20/24] Fix typos in comments
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (18 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 19/24] qtest/ahci: Fix a bit mask expression Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 21/24] hmp: Fix texinfo documentation Michael Tokarev
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Viswesh, Michael Tokarev

From: Viswesh <visweshn92@gmail.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Viswesh <visweshn92@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 fsdev/virtfs-proxy-helper.c |  2 +-
 target-tricore/translate.c  | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 13fe032..a698e2d 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -117,7 +117,7 @@ error:
 
 static int init_capabilities(void)
 {
-    /* helper needs following capbabilities only */
+    /* helper needs following capabilities only */
     cap_value_t cap_list[] = {
         CAP_CHOWN,
         CAP_DAC_OVERRIDE,
diff --git a/target-tricore/translate.c b/target-tricore/translate.c
index 15a24f7..0b7cf06 100644
--- a/target-tricore/translate.c
+++ b/target-tricore/translate.c
@@ -1111,7 +1111,7 @@ gen_m16add32_q(TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3, uint32_t n)
     TCGv temp2 = tcg_temp_new();
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -1131,7 +1131,7 @@ gen_m16adds32_q(TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3, uint32_t n)
     TCGv temp2 = tcg_temp_new();
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -1156,7 +1156,7 @@ gen_m16add64_q(TCGv rl, TCGv rh, TCGv arg1_low, TCGv arg1_high, TCGv arg2,
 
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -1188,7 +1188,7 @@ gen_m16adds64_q(TCGv rl, TCGv rh, TCGv arg1_low, TCGv arg1_high, TCGv arg2,
 
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -1975,7 +1975,7 @@ gen_m16sub32_q(TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3, uint32_t n)
     TCGv temp2 = tcg_temp_new();
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -1995,7 +1995,7 @@ gen_m16subs32_q(TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3, uint32_t n)
     TCGv temp2 = tcg_temp_new();
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -2020,7 +2020,7 @@ gen_m16sub64_q(TCGv rl, TCGv rh, TCGv arg1_low, TCGv arg1_high, TCGv arg2,
 
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -2052,7 +2052,7 @@ gen_m16subs64_q(TCGv rl, TCGv rh, TCGv arg1_low, TCGv arg1_high, TCGv arg2,
 
     if (n == 0) {
         tcg_gen_mul_tl(temp, arg2, arg3);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(temp, arg2, arg3);
         tcg_gen_shli_tl(temp, temp, 1);
         /* catch special case r1 = r2 = 0x8000 */
@@ -2560,7 +2560,7 @@ gen_mul_q(TCGv rl, TCGv rh, TCGv arg1, TCGv arg2, uint32_t n, uint32_t up_shift)
         }
         /* reset v bit */
         tcg_gen_movi_tl(cpu_PSW_V, 0);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_ext_i32_i64(temp_64, arg1);
         tcg_gen_ext_i32_i64(temp2_64, arg2);
 
@@ -2572,7 +2572,7 @@ gen_mul_q(TCGv rl, TCGv rh, TCGv arg1, TCGv arg2, uint32_t n, uint32_t up_shift)
             tcg_gen_shri_i64(temp_64, temp_64, up_shift - 1);
         }
         tcg_gen_extr_i64_i32(rl, rh, temp_64);
-        /* overflow only occours if r1 = r2 = 0x8000 */
+        /* overflow only occurs if r1 = r2 = 0x8000 */
         if (up_shift == 0) {/* result is 64 bit */
             tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_PSW_V, rh,
                                 0x80000000);
@@ -2605,7 +2605,7 @@ gen_mul_q_16(TCGv ret, TCGv arg1, TCGv arg2, uint32_t n)
     TCGv temp = tcg_temp_new();
     if (n == 0) {
         tcg_gen_mul_tl(ret, arg1, arg2);
-    } else { /* n is exspected to be 1 */
+    } else { /* n is expected to be 1 */
         tcg_gen_mul_tl(ret, arg1, arg2);
         tcg_gen_shli_tl(ret, ret, 1);
         /* catch special case r1 = r2 = 0x8000 */
-- 
2.1.4

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

* [Qemu-devel] [PULL 21/24] hmp: Fix texinfo documentation
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (19 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 20/24] Fix typos in comments Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 22/24] elf-loader: Fix truncation warning from coverity Michael Tokarev
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster

From: Markus Armbruster <armbru@redhat.com>

Several issues:

* Commands i and o lack @item.  Their one-liner documentation gets
  squashed into the preceding command print.  Add the obvious @item.

* Commands i, o and cpu-add lack @findex.  The function index doesn't
  have them.  Add the obvious @findex.

* Commit 727f005 put block_set_io_throttle was added in the middle of
  block_passwd.  Move it.

* Correct spelling of commands chardev-add and chardev-remove in @item
  and @findex.

* Some commands have a blank line between @item/@findex and the text,
  most don't.  Normalize to no blank line.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hmp-commands.hx | 41 +++++++++++++++--------------------------
 1 file changed, 15 insertions(+), 26 deletions(-)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index 6fd5336..3089533 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -204,7 +204,6 @@ ETEXI
 STEXI
 @item change @var{device} @var{setting}
 @findex change
-
 Change the configuration of a device.
 
 @table @option
@@ -522,7 +521,6 @@ ETEXI
 STEXI
 @item p or print/@var{fmt} @var{expr}
 @findex print
-
 Print expression value. Only the @var{format} part of @var{fmt} is
 used.
 ETEXI
@@ -536,6 +534,8 @@ ETEXI
     },
 
 STEXI
+@item i/@var{fmt} @var{addr} [.@var{index}]
+@findex i
 Read I/O port.
 ETEXI
 
@@ -548,6 +548,8 @@ ETEXI
     },
 
 STEXI
+@item o/@var{fmt} @var{addr} @var{val}
+@findex o
 Write to I/O port.
 ETEXI
 
@@ -563,7 +565,6 @@ ETEXI
 STEXI
 @item sendkey @var{keys}
 @findex sendkey
-
 Send @var{keys} to the guest. @var{keys} could be the name of the
 key or the raw value in hexadecimal format. Use @code{-} to press
 several keys simultaneously. Example:
@@ -586,7 +587,6 @@ ETEXI
 STEXI
 @item system_reset
 @findex system_reset
-
 Reset the system.
 ETEXI
 
@@ -601,7 +601,6 @@ ETEXI
 STEXI
 @item system_powerdown
 @findex system_powerdown
-
 Power down the system (if supported).
 ETEXI
 
@@ -616,7 +615,6 @@ ETEXI
 STEXI
 @item sum @var{addr} @var{size}
 @findex sum
-
 Compute the checksum of a memory region.
 ETEXI
 
@@ -631,7 +629,6 @@ ETEXI
 STEXI
 @item usb_add @var{devname}
 @findex usb_add
-
 Add the USB device @var{devname}.  For details of available devices see
 @ref{usb_devices}
 ETEXI
@@ -647,7 +644,6 @@ ETEXI
 STEXI
 @item usb_del @var{devname}
 @findex usb_del
-
 Remove the USB device @var{devname} from the QEMU virtual USB
 hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor
 command @code{info usb} to see the devices you can remove.
@@ -666,7 +662,6 @@ ETEXI
 STEXI
 @item device_add @var{config}
 @findex device_add
-
 Add device.
 ETEXI
 
@@ -682,7 +677,6 @@ ETEXI
 STEXI
 @item device_del @var{id}
 @findex device_del
-
 Remove device @var{id}.
 ETEXI
 
@@ -823,7 +817,6 @@ ETEXI
 STEXI
 @item boot_set @var{bootdevicelist}
 @findex boot_set
-
 Define new values for the boot device list. Those values will override
 the values specified on the command line through the @code{-boot} option.
 
@@ -1538,9 +1531,9 @@ ETEXI
     },
 
 STEXI
-@item block_set_io_throttle @var{device} @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
-@findex block_set_io_throttle
-Change I/O throttle limits for a block drive to @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
+@item block_passwd @var{device} @var{password}
+@findex block_passwd
+Set the encrypted device @var{device} password to @var{password}
 ETEXI
 
     {
@@ -1552,9 +1545,9 @@ ETEXI
     },
 
 STEXI
-@item block_passwd @var{device} @var{password}
-@findex block_passwd
-Set the encrypted device @var{device} password to @var{password}
+@item block_set_io_throttle @var{device} @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
+@findex block_set_io_throttle
+Change I/O throttle limits for a block drive to @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
 ETEXI
 
     {
@@ -1568,7 +1561,6 @@ ETEXI
 STEXI
 @item set_password [ vnc | spice ] password [ action-if-connected ]
 @findex set_password
-
 Change spice/vnc password.  Use zero to make the password stay valid
 forever.  @var{action-if-connected} specifies what should happen in
 case a connection is established: @var{fail} makes the password change
@@ -1588,7 +1580,6 @@ ETEXI
 STEXI
 @item expire_password [ vnc | spice ] expire-time
 @findex expire_password
-
 Specify when a password for spice/vnc becomes
 invalid. @var{expire-time} accepts:
 
@@ -1619,9 +1610,8 @@ ETEXI
     },
 
 STEXI
-@item chardev_add args
-@findex chardev_add
-
+@item chardev-add args
+@findex chardev-add
 chardev_add accepts the same parameters as the -chardev command line switch.
 
 ETEXI
@@ -1636,9 +1626,8 @@ ETEXI
     },
 
 STEXI
-@item chardev_remove id
-@findex chardev_remove
-
+@item chardev-remove id
+@findex chardev-remove
 Removes the chardev @var{id}.
 
 ETEXI
@@ -1654,7 +1643,6 @@ ETEXI
 STEXI
 @item qemu-io @var{device} @var{command}
 @findex qemu-io
-
 Executes a qemu-io command on the given block device.
 
 ETEXI
@@ -1669,6 +1657,7 @@ ETEXI
 
 STEXI
 @item cpu-add @var{id}
+@findex cpu-add
 Add CPU with id @var{id}
 ETEXI
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 22/24] elf-loader: Fix truncation warning from coverity
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (20 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 21/24] hmp: Fix texinfo documentation Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 23/24] elf-loader: Add missing error handling for call of lseek Michael Tokarev
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

Coverity reports a truncation due to cast operation on operand
reltab->sh_size from 64 bits to 32 bits for calls of load_at.

Fix the types of the function arguments to match their use in
function load_at: the offset is used for lseek which takes an
off_t parameter, the size is used for g_malloc and read.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/core/loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/loader.c b/hw/core/loader.c
index 76d8aca..d4c441f 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -267,7 +267,7 @@ int load_aout(const char *filename, hwaddr addr, int max_sz,
 
 /* ELF loader */
 
-static void *load_at(int fd, int offset, int size)
+static void *load_at(int fd, off_t offset, size_t size)
 {
     void *ptr;
     if (lseek(fd, offset, SEEK_SET) < 0)
-- 
2.1.4

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

* [Qemu-devel] [PULL 23/24] elf-loader: Add missing error handling for call of lseek
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (21 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 22/24] elf-loader: Fix truncation warning from coverity Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19  9:05 ` [Qemu-devel] [PULL 24/24] qga/commands-posix: Fix resource leak Michael Tokarev
  2015-03-19 16:46 ` [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Peter Maydell
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

This fixes a warning from Coverity.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/hw/elf_ops.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h
index 16a627b..bd71968 100644
--- a/include/hw/elf_ops.h
+++ b/include/hw/elf_ops.h
@@ -315,7 +315,9 @@ static int glue(load_elf, SZ)(const char *name, int fd,
     glue(load_symbols, SZ)(&ehdr, fd, must_swab, clear_lsb);
 
     size = ehdr.e_phnum * sizeof(phdr[0]);
-    lseek(fd, ehdr.e_phoff, SEEK_SET);
+    if (lseek(fd, ehdr.e_phoff, SEEK_SET) != ehdr.e_phoff) {
+        goto fail;
+    }
     phdr = g_malloc0(size);
     if (!phdr)
         goto fail;
-- 
2.1.4

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

* [Qemu-devel] [PULL 24/24] qga/commands-posix: Fix resource leak
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (22 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 23/24] elf-loader: Add missing error handling for call of lseek Michael Tokarev
@ 2015-03-19  9:05 ` Michael Tokarev
  2015-03-19 16:46 ` [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Peter Maydell
  24 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2015-03-19  9:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Shannon Zhao, Shannon Zhao

From: Shannon Zhao <zhaoshenglong@huawei.com>

It's detected by coverity. Close the dirfd.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qga/commands-posix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index d5bb5cb..ba8de62 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -2283,6 +2283,7 @@ GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp)
 
     buf = g_malloc0(20);
     ga_read_sysfs_file(dirfd, "block_size_bytes", buf, 20, &local_err);
+    close(dirfd);
     if (local_err) {
         g_free(buf);
         error_propagate(errp, local_err);
-- 
2.1.4

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

* Re: [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19
  2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
                   ` (23 preceding siblings ...)
  2015-03-19  9:05 ` [Qemu-devel] [PULL 24/24] qga/commands-posix: Fix resource leak Michael Tokarev
@ 2015-03-19 16:46 ` Peter Maydell
  24 siblings, 0 replies; 26+ messages in thread
From: Peter Maydell @ 2015-03-19 16:46 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers

On 19 March 2015 at 09:05, Michael Tokarev <mjt@tls.msk.ru> wrote:
> Here's another trivial-patches pull request, it comes very close to
> the release because I was too busy last 2 weeks to do anything useful
> with the trivial-patches queue, and because it accumulated quite a few
> patches since that.
>
> Here, there are many code defects fixes found by coverity and sparse,
> mostly from Stefan Weil, and also from Gonglei and Shannon Zhao.  There
> are a few other bits and pieces, all look quite harmless.  And a few
> more interesting changes:
>
>  - smbios: add max speed comdline option for type-17 (meory device) structure
>    by Gabriel L. Somlo
>
>  - configure: enable kvm on x32 by Michael Tokarev
>
>  - error: Replace error_report() & error_free() with error_report_err()
>    by zhanghailiang
>
> These aren't completely trivial, but again, should not have much impact,
> and has been in the queue for quite some time too.
>
> Please consider applying.
>
> I omited a few other patches sent to -trivial for now, partly to speed up
> processing of other patches, partly because some patches better wait for
> 2.4, and partly because some patches, in my opinion, needs one or another
> work.  I'll post comments about these as replies to individual patches
> posted.
>
> Thanks,
>
> /mjt
>
> The following changes since commit cd232acfa0d70002fed89e9293f04afda577a513:
>
>   Update version for v2.3.0-rc0 release (2015-03-17 18:58:33 +0000)
>
> are available in the git repository at:
>
>   git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2015-03-19
>
> for you to fetch changes up to 8ce1ee4618f4a557959f5a5731f6726b30416df5:
>
>   qga/commands-posix: Fix resource leak (2015-03-19 11:39:18 +0300)
>
> ----------------------------------------------------------------
> trivial patches for 2015-03-19
>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2015-03-19 16:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  9:05 [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 01/24] cris: remove unused cris_cond15 declarations Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 02/24] backends: Fix warning from Sparse Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 03/24] 9pfs: Fix warnings " Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 04/24] omap: " Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 05/24] arm/nseries: " Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 06/24] target-mips: Fix warning " Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 07/24] qom: " Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 08/24] Fix remaining warnings from Sparse (void return) Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 09/24] block/qapi: Fix Sparse warning Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 10/24] target-moxie: Fix warnings from Sparse (one-bit signed bitfield) Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 11/24] hmp: Fix definition of command quit Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 12/24] qmp: Drop unused .user_print from command definitions Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 13/24] arm: fix memory leak Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 14/24] error: Replace error_report() & error_free() with error_report_err() Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 15/24] configure: enable kvm on x32 Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 16/24] pc-dimm: Add description for device list Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 17/24] smbios: add max speed comdline option for type-17 (meory device) structure Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 18/24] vl: fix resource leak with monitor_fdset_add_fd Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 19/24] qtest/ahci: Fix a bit mask expression Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 20/24] Fix typos in comments Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 21/24] hmp: Fix texinfo documentation Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 22/24] elf-loader: Fix truncation warning from coverity Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 23/24] elf-loader: Add missing error handling for call of lseek Michael Tokarev
2015-03-19  9:05 ` [Qemu-devel] [PULL 24/24] qga/commands-posix: Fix resource leak Michael Tokarev
2015-03-19 16:46 ` [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19 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.