Commit 21ca4a5b authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'mjt/trivial-patches' into staging



# By Stefan Weil (5) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  configure: Add signed*signed check to [u]int128_t test
  Makefile: pass include directives to dtc via CPPFLAGS, not CFLAGS
  qapi: lack of two commas in dict
  sd: pass bool parameter for sd_init
  qemu-char: use bool in qemu_chr_open_socket and simplify code a bit
  vnc: use booleans for vnc_connect, vnc_listen_read and vnc_display_add_client
  block/nand: Formatting sweep
  qxl: Fix QXLRam initialisation.
  acl: acl_add can't insert before last list element, fix
  configure: Fix "ERROR: ERROR: " for missing/incompatible DTC
  audio: Replace static functions in header file by macros, remove GCC_ATTR
  libcacard: Fix cppcheck warning and remove unneeded code
  savevm: Fix potential memory leak
  kvm: Fix potential resource leak (missing fclose)
  qemu-img: Add missing GCC_FMT_ATTR
  qemu-options: trivial fix for -mon args help
  vl: reformat SDL ifdeffery a bit

Message-id: 1371893076-9643-1-git-send-email-mjt@msgid.tls.msk.ru
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parents b52df465 464e3671
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -146,10 +146,11 @@ $(SRC_PATH)/pixman/configure:
	(cd $(SRC_PATH)/pixman; autoreconf -v --install)

DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) -I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt

subdir-dtc:dtc/libfdt dtc/tests
	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)

dtc/%:
	mkdir -p $@
+3 −28
Original line number Diff line number Diff line
@@ -243,38 +243,13 @@ static inline int audio_ring_dist (int dst, int src, int len)
    return (dst >= src) ? (dst - src) : (len - src + dst);
}

static void GCC_ATTR dolog (const char *fmt, ...)
{
    va_list ap;

    va_start (ap, fmt);
    AUD_vlog (AUDIO_CAP, fmt, ap);
    va_end (ap);
}
#define dolog(fmt, ...) AUD_log(AUDIO_CAP, fmt, ## __VA_ARGS__)

#ifdef DEBUG
static void GCC_ATTR ldebug (const char *fmt, ...)
{
    va_list ap;

    va_start (ap, fmt);
    AUD_vlog (AUDIO_CAP, fmt, ap);
    va_end (ap);
}
#define ldebug(fmt, ...) AUD_log(AUDIO_CAP, fmt, ## __VA_ARGS__)
#else
#if defined NDEBUG && defined __GNUC__
#define ldebug(...)
#elif defined NDEBUG && defined _MSC_VER
#define ldebug __noop
#else
static void GCC_ATTR ldebug (const char *fmt, ...)
{
    (void) fmt;
}
#define ldebug(fmt, ...) (void)0
#endif
#endif

#undef GCC_ATTR

#define AUDIO_STRINGIFY_(n) #n
#define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n)
+2 −1
Original line number Diff line number Diff line
@@ -2529,7 +2529,7 @@ EOF
    fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
  elif test "$fdt" = "yes" ; then
    # have neither and want - prompt for system/submodule install
    error_exit "ERROR: DTC not present. Your options:" \
    error_exit "DTC not present. Your options:" \
        "  (1) Preferred: Install the DTC devel package" \
        "  (2) Fetch the DTC submodule, using:" \
        "      git submodule update --init dtc"
@@ -3329,6 +3329,7 @@ __uint128_t b;
int main (void) {
  a = a + b;
  b = a * b;
  a = a * a;
  return 0;
}
EOF
+18 −15
Original line number Diff line number Diff line
@@ -298,10 +298,8 @@ static void nand_command(NANDFlashState *s)

    case NAND_CMD_BLOCKERASE2:
        s->addr &= (1ull << s->addrlen * 8) - 1;
        if (nand_flash_ids[s->chip_id].options & NAND_SAMSUNG_LP)
            s->addr <<= 16;
        else
            s->addr <<= 8;
        s->addr <<= nand_flash_ids[s->chip_id].options & NAND_SAMSUNG_LP ?
                                                                    16 : 8;

        if (s->wp) {
            s->blk_erase(s);
@@ -464,11 +462,12 @@ void nand_setpins(DeviceState *dev, uint8_t cle, uint8_t ale,
    s->ce = ce;
    s->wp = wp;
    s->gnd = gnd;
    if (wp)
    if (wp) {
        s->status |= NAND_IOSTATUS_UNPROTCT;
    else
    } else {
        s->status &= ~NAND_IOSTATUS_UNPROTCT;
    }
}

void nand_getpins(DeviceState *dev, int *rb)
{
@@ -489,13 +488,12 @@ void nand_setio(DeviceState *dev, uint32_t value)
                return;
            }
        }
        if (value == NAND_CMD_READ0)
        if (value == NAND_CMD_READ0) {
            s->offset = 0;
	else if (value == NAND_CMD_READ1) {
        } else if (value == NAND_CMD_READ1) {
            s->offset = 0x100;
            value = NAND_CMD_READ0;
        }
	else if (value == NAND_CMD_READ2) {
        } else if (value == NAND_CMD_READ2) {
            s->offset = 1 << s->page_shift;
            value = NAND_CMD_READ0;
        }
@@ -508,8 +506,9 @@ void nand_setio(DeviceState *dev, uint32_t value)
                s->cmd == NAND_CMD_BLOCKERASE2 ||
                s->cmd == NAND_CMD_NOSERIALREAD2 ||
                s->cmd == NAND_CMD_RANDOMREAD2 ||
                s->cmd == NAND_CMD_RESET)
                s->cmd == NAND_CMD_RESET) {
            nand_command(s);
        }

        if (s->cmd != NAND_CMD_RANDOMREAD2) {
            s->addrlen = 0;
@@ -596,8 +595,9 @@ uint32_t nand_getio(DeviceState *dev)
            s->iolen = (1 << s->page_shift) + (1 << s->oob_shift) - offset;
    }

    if (s->ce || s->iolen <= 0)
    if (s->ce || s->iolen <= 0) {
        return 0;
    }

    for (offset = s->buswidth; offset--;) {
        x |= s->ioaddr[offset] << (offset << 3);
@@ -696,8 +696,9 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
    uint8_t iobuf[0x200] = { [0 ... 0x1ff] = 0xff, };
    addr = s->addr & ~((1 << (ADDR_SHIFT + s->erase_shift)) - 1);

    if (PAGE(addr) >= s->pages)
    if (PAGE(addr) >= s->pages) {
        return;
    }

    if (!s->bdrv) {
        memset(s->storage + PAGE_START(addr),
@@ -725,11 +726,12 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
        memset(iobuf, 0xff, 0x200);
        i = (addr & ~0x1ff) + 0x200;
        for (addr += ((PAGE_SIZE + OOB_SIZE) << s->erase_shift) - 0x200;
                        i < addr; i += 0x200)
                        i < addr; i += 0x200) {
            if (bdrv_write(s->bdrv, i >> 9, iobuf, 1) < 0) {
                printf("%s: write error in sector %" PRIu64 "\n",
                       __func__, i >> 9);
            }
        }

        page = i >> 9;
        if (bdrv_read(s->bdrv, page, iobuf, 1) < 0) {
@@ -745,8 +747,9 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s,
                uint64_t addr, int offset)
{
    if (PAGE(addr) >= s->pages)
    if (PAGE(addr) >= s->pages) {
        return;
    }

    if (s->bdrv) {
        if (s->mem_oob) {
+1 −0
Original line number Diff line number Diff line
@@ -387,6 +387,7 @@ static void init_qxl_ram(PCIQXLDevice *d)
    d->ram->int_pending = cpu_to_le32(0);
    d->ram->int_mask    = cpu_to_le32(0);
    d->ram->update_surface = 0;
    d->ram->monitors_config = 0;
    SPICE_RING_INIT(&d->ram->cmd_ring);
    SPICE_RING_INIT(&d->ram->cursor_ring);
    SPICE_RING_INIT(&d->ram->release_ring);
Loading