Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pul…
Browse files Browse the repository at this point in the history
…l-request' into staging

Fix memory leak with fdt
cosmetic change in code and logs
update mailmap

# gpg: Signature made Wed 19 Feb 2020 10:15:56 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-pull-request:
  hw/xtensa/xtfpga:fix leak of fdevice tree blob
  hw/nios2:fix leak of fdevice tree blob
  hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP)
  hw/block/pflash_cfi02: Remove unneeded variable assignment
  hw/display/qxl: Remove unneeded variable assignment
  contrib/rdmacm-mux: Remove superfluous semicolon
  tests/qtest/libqos/qgraph: Remove superfluous semicolons
  target/i386/whpx: Remove superfluous semicolon
  ui/input-barrier: Remove superfluous semicolon
  hw/vfio/display: Remove superfluous semicolon
  hw/scsi/esp: Remove superfluous semicolon
  hw/m68k/next-cube: Remove superfluous semicolon
  hw/arm/xlnx-versal: Remove superfluous semicolon
  audio/alsaaudio: Remove superfluous semicolons
  scripts/checkpatch.pl: Detect superfluous semicolon in C code
  Report stringified errno in VFIO related errors
  mailmap: Add entry for Yu-Chen Lin

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Feb 20, 2020
2 parents 8cd7325 + d1cb678 commit 7afee87
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .mailmap
Expand Up @@ -152,7 +152,8 @@ Xiaoqiang Zhao <zxq_yx_007@163.com>
Xinhua Cao <caoxinhua@huawei.com>
Xiong Zhang <xiong.y.zhang@intel.com>
Yin Yin <yin.yin@cs2c.com.cn>
yuchenlin <npes87184@gmail.com>
Yu-Chen Lin <npes87184@gmail.com>
Yu-Chen Lin <npes87184@gmail.com> <yuchenlin@synology.com>
YunQiang Su <syq@debian.org>
YunQiang Su <ysu@wavecomp.com>
Yuri Pudgorodskiy <yur@virtuozzo.com>
Expand Down
4 changes: 2 additions & 2 deletions audio/alsaaudio.c
Expand Up @@ -819,7 +819,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
switch (nread) {
case 0:
trace_alsa_read_zero(len);
return pos;;
return pos;

case -EPIPE:
if (alsa_recover(alsa->handle)) {
Expand All @@ -835,7 +835,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
default:
alsa_logerr(nread, "Failed to read %zu frames to %p\n",
len, dst);
return pos;;
return pos;
}
}

Expand Down
2 changes: 1 addition & 1 deletion contrib/rdmacm-mux/main.c
Expand Up @@ -490,7 +490,7 @@ static int read_and_process(int fd)

static int accept_all(void)
{
int fd, rc = 0;;
int fd, rc = 0;

pthread_rwlock_wrlock(&server.lock);

Expand Down
2 changes: 1 addition & 1 deletion hw/arm/xlnx-versal-virt.c
Expand Up @@ -350,7 +350,7 @@ static void create_virtio_regions(VersalVirt *s)
int i;

for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
char *name = g_strdup_printf("virtio%d", i);;
char *name = g_strdup_printf("virtio%d", i);
hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
int irq = VERSAL_RSVD_IRQ_FIRST + i;
MemoryRegion *mr;
Expand Down
1 change: 0 additions & 1 deletion hw/block/pflash_cfi02.c
Expand Up @@ -308,7 +308,6 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
hwaddr boff;
uint64_t ret;

ret = -1;
/* Lazy reset to ROMD mode after a certain amount of read accesses */
if (!pfl->rom_mode && pfl->wcycle == 0 &&
++pfl->read_counter > PFLASH_LAZY_ROMD_THRESHOLD) {
Expand Down
2 changes: 1 addition & 1 deletion hw/display/qxl.c
Expand Up @@ -1631,7 +1631,7 @@ static void ioport_write(void *opaque, hwaddr addr,
PCIQXLDevice *d = opaque;
uint32_t io_port = addr;
qxl_async_io async = QXL_SYNC;
uint32_t orig_io_port = io_port;
uint32_t orig_io_port;

if (d->guest_bug && io_port != QXL_IO_RESET) {
return;
Expand Down
2 changes: 1 addition & 1 deletion hw/m68k/next-cube.c
Expand Up @@ -734,7 +734,7 @@ void next_irq(void *opaque, int number, int level)
switch (number) {
/* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */
case NEXT_FD_I:
shift = 7;;
shift = 7;
break;
case NEXT_KBD_I:
shift = 3;
Expand Down
15 changes: 9 additions & 6 deletions hw/net/rocker/rocker.c
Expand Up @@ -27,6 +27,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/bitops.h"
#include "qemu/log.h"

#include "rocker.h"
#include "rocker_hw.h"
Expand Down Expand Up @@ -207,14 +208,22 @@ static int tx_consume(Rocker *r, DescInfo *info)

if (tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]) {
tx_l3_csum_off = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]);
qemu_log_mask(LOG_UNIMP, "rocker %s: L3 not implemented"
" (cksum off: %u)\n",
__func__, tx_l3_csum_off);
}

if (tlvs[ROCKER_TLV_TX_TSO_MSS]) {
tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented (MSS: %u)\n",
__func__, tx_tso_mss);
}

if (tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]) {
tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented"
" (hdr length: %u)\n",
__func__, tx_tso_hdr_len);
}

rocker_tlv_for_each_nested(tlv_frag, tlvs[ROCKER_TLV_TX_FRAGS], rem) {
Expand Down Expand Up @@ -249,12 +258,6 @@ static int tx_consume(Rocker *r, DescInfo *info)
iovcnt++;
}

if (iovcnt) {
/* XXX perform Tx offloads */
/* XXX silence compiler for now */
tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
}

err = fp_port_eg(r->fp_port[port], iov, iovcnt);

err_too_many_frags:
Expand Down
1 change: 1 addition & 0 deletions hw/nios2/boot.c
Expand Up @@ -109,6 +109,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, const uint32_t ramsize,
}

cpu_physical_memory_write(bi.fdt, fdt, fdt_size);
g_free(fdt);
return fdt_size;
}

Expand Down
2 changes: 1 addition & 1 deletion hw/scsi/esp.c
Expand Up @@ -293,7 +293,7 @@ static void handle_satn_stop(ESPState *s)
s->dma_cb = handle_satn_stop;
return;
}
s->pdma_cb = satn_stop_pdma_cb;;
s->pdma_cb = satn_stop_pdma_cb;
s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
if (s->cmdlen) {
trace_esp_handle_satn_stop(s->cmdlen);
Expand Down
4 changes: 2 additions & 2 deletions hw/vfio/common.c
Expand Up @@ -319,7 +319,7 @@ static int vfio_dma_unmap(VFIOContainer *container,
unmap.size -= 1ULL << ctz64(container->pgsizes);
continue;
}
error_report("VFIO_UNMAP_DMA: %d", -errno);
error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno));
return -errno;
}

Expand Down Expand Up @@ -352,7 +352,7 @@ static int vfio_dma_map(VFIOContainer *container, hwaddr iova,
return 0;
}

error_report("VFIO_MAP_DMA: %d", -errno);
error_report("VFIO_MAP_DMA failed: %s", strerror(errno));
return -errno;
}

Expand Down
2 changes: 1 addition & 1 deletion hw/vfio/display.c
Expand Up @@ -287,7 +287,7 @@ static void vfio_display_dmabuf_update(void *opaque)
VFIOPCIDevice *vdev = opaque;
VFIODisplay *dpy = vdev->dpy;
VFIODMABuf *primary, *cursor;
bool free_bufs = false, new_cursor = false;;
bool free_bufs = false, new_cursor = false;

primary = vfio_display_get_dmabuf(vdev, DRM_PLANE_TYPE_PRIMARY);
if (primary == NULL) {
Expand Down
1 change: 1 addition & 0 deletions hw/xtensa/xtfpga.c
Expand Up @@ -380,6 +380,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT,
sizeof(dtb_addr), &dtb_addr);
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB);
g_free(fdt);
}
#else
if (dtb_filename) {
Expand Down
5 changes: 5 additions & 0 deletions scripts/checkpatch.pl
Expand Up @@ -1830,6 +1830,11 @@ sub process {
ERROR("suspicious ; after while (0)\n" . $herecurr);
}

# Check superfluous trailing ';'
if ($line =~ /;;$/) {
ERROR("superfluous trailing semicolon\n" . $herecurr);
}

# Check relative indent for conditionals and blocks.
if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
my ($s, $c) = ($stat, $cond);
Expand Down
2 changes: 1 addition & 1 deletion target/i386/whpx-all.c
Expand Up @@ -511,7 +511,7 @@ static void whpx_get_registers(CPUState *cpu)
/* WHvX64RegisterPat - Skipped */

assert(whpx_register_names[idx] == WHvX64RegisterSysenterCs);
env->sysenter_cs = vcxt.values[idx++].Reg64;;
env->sysenter_cs = vcxt.values[idx++].Reg64;
assert(whpx_register_names[idx] == WHvX64RegisterSysenterEip);
env->sysenter_eip = vcxt.values[idx++].Reg64;
assert(whpx_register_names[idx] == WHvX64RegisterSysenterEsp);
Expand Down
4 changes: 2 additions & 2 deletions tests/qtest/libqos/qgraph.c
Expand Up @@ -474,7 +474,7 @@ QOSEdgeType qos_graph_edge_get_type(QOSGraphEdge *edge)
if (!edge) {
return -1;
}
return edge->type;;
return edge->type;
}

char *qos_graph_edge_get_dest(QOSGraphEdge *edge)
Expand Down Expand Up @@ -590,7 +590,7 @@ void qos_add_test(const char *name, const char *interface,
QOSTestFunc test_func, QOSGraphTestOptions *opts)
{
QOSGraphNode *node;
char *test_name = g_strdup_printf("%s-tests/%s", interface, name);;
char *test_name = g_strdup_printf("%s-tests/%s", interface, name);
QOSGraphTestOptions def_opts = { };

if (!opts) {
Expand Down
2 changes: 1 addition & 1 deletion ui/input-barrier.c
Expand Up @@ -455,7 +455,7 @@ static gboolean writecmd(InputBarrier *ib, struct barrierMsg *msg)
break;
default:
write_cmd(p, barrierCmdEUnknown, avail);
break;;
break;
}

len = MAX_HELLO_LENGTH - avail - sizeof(int);
Expand Down
6 changes: 3 additions & 3 deletions util/vfio-helpers.c
Expand Up @@ -545,7 +545,7 @@ static int qemu_vfio_do_mapping(QEMUVFIOState *s, void *host, size_t size,
trace_qemu_vfio_do_mapping(s, host, size, iova);

if (ioctl(s->container, VFIO_IOMMU_MAP_DMA, &dma_map)) {
error_report("VFIO_MAP_DMA: %d", -errno);
error_report("VFIO_MAP_DMA failed: %s", strerror(errno));
return -errno;
}
return 0;
Expand All @@ -570,7 +570,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s, IOVAMapping *mapping,
assert(QEMU_IS_ALIGNED(mapping->size, qemu_real_host_page_size));
assert(index >= 0 && index < s->nr_mappings);
if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
error_setg(errp, "VFIO_UNMAP_DMA failed: %d", -errno);
error_setg_errno(errp, errno, "VFIO_UNMAP_DMA failed");
}
memmove(mapping, &s->mappings[index + 1],
sizeof(s->mappings[0]) * (s->nr_mappings - index - 1));
Expand Down Expand Up @@ -669,7 +669,7 @@ int qemu_vfio_dma_reset_temporary(QEMUVFIOState *s)
trace_qemu_vfio_dma_reset_temporary(s);
qemu_mutex_lock(&s->lock);
if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
error_report("VFIO_UNMAP_DMA: %d", -errno);
error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno));
qemu_mutex_unlock(&s->lock);
return -errno;
}
Expand Down

0 comments on commit 7afee87

Please sign in to comment.