Skip to content

Commit

Permalink
Merge remote-tracking branch 'mjt/trivial-patches' into staging
Browse files Browse the repository at this point in the history
# By Stefan Weil (9) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  eeprom93xx: fix coding style
  hw/ppc/mac.h: remove unused BIOS_FILENAME definition
  Don't crash on keyboard input with no handler
  libcacard/vcard_emul_nss: Remove unused statement (value stored is never read)
  libcacard/cac: Remove unused statement (value stored is never read)
  virtio-net: fix the indent
  misc: Replace 'struct QEMUTimer' by 'QEMUTimer'
  qobject: Fix compiler warning (missing gnu_printf format attribute)
  acpi-build: Fix compiler warning (missing gnu_printf format attribute)
  .gitignore: Ignore config.status
  gtk: Replace conditional debug messages by trace methods
  console: Replace conditional debug messages by trace methods
  trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)
  trace: Remove trace.h from console.h (less dependencies)

Message-id: 1385408466-13183-1-git-send-email-mjt@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
  • Loading branch information
Anthony Liguori committed Dec 6, 2013
2 parents 7dc65c0 + 6fedcaa commit 783eb67
Show file tree
Hide file tree
Showing 27 changed files with 76 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@ config-all-devices.*
config-all-disas.*
config-host.*
config-target.*
config.status
trace/generated-tracers.h
trace/generated-tracers.c
trace/generated-tracers-dtrace.h
Expand Down
4 changes: 2 additions & 2 deletions hw/char/cadence_uart.c
Expand Up @@ -120,8 +120,8 @@ typedef struct {
uint64_t char_tx_time;
CharDriverState *chr;
qemu_irq irq;
struct QEMUTimer *fifo_trigger_handle;
struct QEMUTimer *tx_time_handle;
QEMUTimer *fifo_trigger_handle;
QEMUTimer *tx_time_handle;
} UartState;

static void uart_update_status(UartState *s)
Expand Down
1 change: 1 addition & 0 deletions hw/display/vmware_vga.c
Expand Up @@ -23,6 +23,7 @@
*/
#include "hw/hw.h"
#include "hw/loader.h"
#include "trace.h"
#include "ui/console.h"
#include "hw/pci/pci.h"

Expand Down
5 changes: 3 additions & 2 deletions hw/i386/acpi-build.c
Expand Up @@ -285,7 +285,8 @@ static inline void build_append_array(GArray *array, GArray *val)
g_array_append_vals(array, val->data, val->len);
}

static void build_append_nameseg(GArray *array, const char *format, ...)
static void GCC_FMT_ATTR(2, 3)
build_append_nameseg(GArray *array, const char *format, ...)
{
/* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
char s[] = "XXXX";
Expand Down Expand Up @@ -630,7 +631,7 @@ build_append_notify(GArray *device, const char *name,
GArray *method = build_alloc_array();
uint8_t op = 0x14; /* MethodOp */

build_append_nameseg(method, name);
build_append_nameseg(method, "%s", name);
build_append_byte(method, 0x02); /* MethodFlags: ArgCount */
for (i = skip; i < count; i++) {
GArray *target = build_alloc_array();
Expand Down
2 changes: 1 addition & 1 deletion hw/net/virtio-net.c
Expand Up @@ -1428,7 +1428,7 @@ static NetClientInfo net_virtio_info = {
.size = sizeof(NICState),
.can_receive = virtio_net_can_receive,
.receive = virtio_net_receive,
.cleanup = virtio_net_cleanup,
.cleanup = virtio_net_cleanup,
.link_status_changed = virtio_net_set_link_status,
.query_rx_filter = virtio_net_query_rxfilter,
};
Expand Down
62 changes: 31 additions & 31 deletions hw/nvram/eeprom93xx.c
Expand Up @@ -126,7 +126,7 @@ static const VMStateDescription vmstate_eeprom = {
.version_id = EEPROM_VERSION,
.minimum_version_id = OLD_EEPROM_VERSION,
.minimum_version_id_old = OLD_EEPROM_VERSION,
.fields = (VMStateField []) {
.fields = (VMStateField[]) {
VMSTATE_UINT8(tick, eeprom_t),
VMSTATE_UINT8(address, eeprom_t),
VMSTATE_UINT8(command, eeprom_t),
Expand Down Expand Up @@ -157,13 +157,13 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
logout("CS=%u SK=%u DI=%u DO=%u, tick = %u\n",
eecs, eesk, eedi, eedo, tick);

if (! eeprom->eecs && eecs) {
if (!eeprom->eecs && eecs) {
/* Start chip select cycle. */
logout("Cycle start, waiting for 1st start bit (0)\n");
tick = 0;
command = 0x0;
address = 0x0;
} else if (eeprom->eecs && ! eecs) {
} else if (eeprom->eecs && !eecs) {
/* End chip select cycle. This triggers write / erase. */
if (eeprom->writable) {
uint8_t subcommand = address >> (eeprom->addrbits - 2);
Expand All @@ -189,7 +189,7 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
}
/* Output DO is tristate, read results in 1. */
eedo = 1;
} else if (eecs && ! eeprom->eesk && eesk) {
} else if (eecs && !eeprom->eesk && eesk) {
/* Raising edge of clock shifts data in. */
if (tick == 0) {
/* Wait for 1st start bit. */
Expand Down Expand Up @@ -230,20 +230,20 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
if (command == 0) {
/* Command code in upper 2 bits of address. */
switch (address >> (eeprom->addrbits - 2)) {
case 0:
logout("write disable command\n");
eeprom->writable = 0;
break;
case 1:
logout("write all command\n");
break;
case 2:
logout("erase all command\n");
break;
case 3:
logout("write enable command\n");
eeprom->writable = 1;
break;
case 0:
logout("write disable command\n");
eeprom->writable = 0;
break;
case 1:
logout("write all command\n");
break;
case 2:
logout("erase all command\n");
break;
case 3:
logout("write enable command\n");
eeprom->writable = 1;
break;
}
} else {
/* Read, write or erase word. */
Expand Down Expand Up @@ -276,7 +276,7 @@ uint16_t eeprom93xx_read(eeprom_t *eeprom)
{
/* Return status of pin DO (0 or 1). */
logout("CS=%u DO=%u\n", eeprom->eecs, eeprom->eedo);
return (eeprom->eedo);
return eeprom->eedo;
}

#if 0
Expand All @@ -296,18 +296,18 @@ eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
uint8_t addrbits;

switch (nwords) {
case 16:
case 64:
addrbits = 6;
break;
case 128:
case 256:
addrbits = 8;
break;
default:
assert(!"Unsupported EEPROM size, fallback to 64 words!");
nwords = 64;
addrbits = 6;
case 16:
case 64:
addrbits = 6;
break;
case 128:
case 256:
addrbits = 8;
break;
default:
assert(!"Unsupported EEPROM size, fallback to 64 words!");
nwords = 64;
addrbits = 6;
}

eeprom = (eeprom_t *)g_malloc0(sizeof(*eeprom) + nwords * 2);
Expand Down
1 change: 0 additions & 1 deletion hw/ppc/mac.h
Expand Up @@ -34,7 +34,6 @@
#define MAX_CPUS 1

#define BIOS_SIZE (1024 * 1024)
#define BIOS_FILENAME "ppc_rom.bin"
#define NVRAM_SIZE 0x2000
#define PROM_FILENAME "openbios-ppc"
#define PROM_ADDR 0xfff00000
Expand Down
6 changes: 3 additions & 3 deletions hw/ppc/ppc.c
Expand Up @@ -684,7 +684,7 @@ static inline void cpu_ppc_hdecr_excp(PowerPCCPU *cpu)
}

static void __cpu_ppc_store_decr(PowerPCCPU *cpu, uint64_t *nextp,
struct QEMUTimer *timer,
QEMUTimer *timer,
void (*raise_excp)(PowerPCCPU *),
uint32_t decr, uint32_t value,
int is_excp)
Expand Down Expand Up @@ -856,9 +856,9 @@ typedef struct ppc40x_timer_t ppc40x_timer_t;
struct ppc40x_timer_t {
uint64_t pit_reload; /* PIT auto-reload value */
uint64_t fit_next; /* Tick for next FIT interrupt */
struct QEMUTimer *fit_timer;
QEMUTimer *fit_timer;
uint64_t wdt_next; /* Tick for next WDT interrupt */
struct QEMUTimer *wdt_timer;
QEMUTimer *wdt_timer;

/* 405 have the PIT, 440 have a DECR. */
unsigned int decr_excp;
Expand Down
2 changes: 1 addition & 1 deletion hw/ppc/ppc405_uc.c
Expand Up @@ -1234,7 +1234,7 @@ struct ppc4xx_gpt_t {
MemoryRegion iomem;
int64_t tb_offset;
uint32_t tb_freq;
struct QEMUTimer *timer;
QEMUTimer *timer;
qemu_irq irqs[5];
uint32_t oe;
uint32_t ol;
Expand Down
4 changes: 2 additions & 2 deletions hw/ppc/ppc_booke.c
Expand Up @@ -64,10 +64,10 @@ typedef struct booke_timer_t booke_timer_t;
struct booke_timer_t {

uint64_t fit_next;
struct QEMUTimer *fit_timer;
QEMUTimer *fit_timer;

uint64_t wdt_next;
struct QEMUTimer *wdt_timer;
QEMUTimer *wdt_timer;

uint32_t flags;
};
Expand Down
4 changes: 2 additions & 2 deletions hw/timer/m48t59.c
Expand Up @@ -61,8 +61,8 @@ struct M48t59State {
time_t stop_time;
/* Alarm & watchdog */
struct tm alarm;
struct QEMUTimer *alrm_timer;
struct QEMUTimer *wd_timer;
QEMUTimer *alrm_timer;
QEMUTimer *wd_timer;
/* NVRAM storage */
uint8_t *buffer;
/* Model parameters */
Expand Down
1 change: 1 addition & 0 deletions hw/usb/hcd-ehci.c
Expand Up @@ -28,6 +28,7 @@
*/

#include "hw/usb/hcd-ehci.h"
#include "trace.h"

/* Capability Registers Base Address - section 2.2 */
#define CAPLENGTH 0x0000 /* 1-byte, 0x0001 reserved */
Expand Down
1 change: 0 additions & 1 deletion hw/usb/hcd-ehci.h
Expand Up @@ -21,7 +21,6 @@
#include "qemu/timer.h"
#include "hw/usb.h"
#include "monitor/monitor.h"
#include "trace.h"
#include "sysemu/dma.h"
#include "sysemu/sysemu.h"
#include "hw/pci/pci.h"
Expand Down
4 changes: 2 additions & 2 deletions include/hw/char/serial.h
Expand Up @@ -65,13 +65,13 @@ struct SerialState {
/* Interrupt trigger level for recv_fifo */
uint8_t recv_fifo_itl;

struct QEMUTimer *fifo_timeout_timer;
QEMUTimer *fifo_timeout_timer;
int timeout_ipending; /* timeout interrupt pending state */

uint64_t char_transmit_time; /* time to transmit a char in ticks */
int poll_msl;

struct QEMUTimer *modem_status_poll;
QEMUTimer *modem_status_poll;
MemoryRegion io;
};

Expand Down
4 changes: 2 additions & 2 deletions include/hw/ppc/ppc.h
Expand Up @@ -24,10 +24,10 @@ struct ppc_tb_t {
/* Decrementer management */
uint64_t decr_next; /* Tick for next decr interrupt */
uint32_t decr_freq; /* decrementer frequency */
struct QEMUTimer *decr_timer;
QEMUTimer *decr_timer;
/* Hypervisor decrementer management */
uint64_t hdecr_next; /* Tick for next hdecr interrupt */
struct QEMUTimer *hdecr_timer;
QEMUTimer *hdecr_timer;
uint64_t purr_load;
uint64_t purr_start;
void *opaque;
Expand Down
1 change: 0 additions & 1 deletion include/ui/console.h
Expand Up @@ -6,7 +6,6 @@
#include "qapi/qmp/qdict.h"
#include "qemu/notify.h"
#include "monitor/monitor.h"
#include "trace.h"
#include "qapi-types.h"
#include "qapi/error.h"

Expand Down
1 change: 0 additions & 1 deletion libcacard/cac.c
Expand Up @@ -189,7 +189,6 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
pki_applet->sign_buffer = sign_buffer;
pki_applet->sign_buffer_len = size;
*response = vcard_make_response(VCARD7816_STATUS_SUCCESS);
ret = VCARD_DONE;
break;
case 0x00:
/* we now have the whole buffer, do the operation, result will be
Expand Down
1 change: 0 additions & 1 deletion libcacard/vcard_emul_nss.c
Expand Up @@ -934,7 +934,6 @@ vcard_emul_init(const VCardEmulOptions *options)
vreader = vreader_new(options->vreader[i].vname, vreader_emul,
vreader_emul_delete);
vreader_add_reader(vreader);
cert_count = options->vreader[i].cert_count;

vcard_emul_alloc_arrays(&certs, &cert_len, &keys,
options->vreader[i].cert_count);
Expand Down
4 changes: 2 additions & 2 deletions qobject/qerror.c
Expand Up @@ -42,8 +42,8 @@ static QError *qerror_new(void)
*
* Return strong reference.
*/
static QError *qerror_from_info(ErrorClass err_class, const char *fmt,
va_list *va)
static QError * GCC_FMT_ATTR(2, 0)
qerror_from_info(ErrorClass err_class, const char *fmt, va_list *va)
{
QError *qerr;

Expand Down
2 changes: 1 addition & 1 deletion target-alpha/cpu-qom.h
Expand Up @@ -62,7 +62,7 @@ typedef struct AlphaCPU {
CPUAlphaState env;

/* This alarm doesn't exist in real hardware; we wish it did. */
struct QEMUTimer *alarm_timer;
QEMUTimer *alarm_timer;
} AlphaCPU;

static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
Expand Down
2 changes: 1 addition & 1 deletion target-mips/cpu.h
Expand Up @@ -476,7 +476,7 @@ struct CPUMIPSState {

const mips_def_t *cpu_model;
void *irq[8];
struct QEMUTimer *timer; /* Internal timer */
QEMUTimer *timer; /* Internal timer */
};

#include "cpu-qom.h"
Expand Down
2 changes: 1 addition & 1 deletion target-openrisc/cpu.h
Expand Up @@ -307,7 +307,7 @@ typedef struct CPUOpenRISCState {
#ifndef CONFIG_USER_ONLY
CPUOpenRISCTLBContext * tlb;

struct QEMUTimer *timer;
QEMUTimer *timer;
uint32_t ttmr; /* Timer tick mode register */
uint32_t ttcr; /* Timer tick count register */

Expand Down
2 changes: 1 addition & 1 deletion target-sparc/cpu.h
Expand Up @@ -370,7 +370,7 @@ struct CPUTimer
uint32_t disabled;
uint64_t disabled_mask;
int64_t clock_offset;
struct QEMUTimer *qtimer;
QEMUTimer *qtimer;
};

typedef struct CPUTimer CPUTimer;
Expand Down
7 changes: 7 additions & 0 deletions trace-events
Expand Up @@ -1010,6 +1010,8 @@ dma_map_wait(void *dbs) "dbs=%p"

# ui/console.c
console_gfx_new(void) ""
console_putchar_csi(int esc_param0, int esc_param1, int ch, int nb_esc_params) "escape sequence CSI%d;%d%c, %d parameters"
console_putchar_unhandled(int ch) "unhandled escape character '%c'"
console_txt_new(int w, int h) "%dx%d"
console_select(int nr) "%d"
console_refresh(int interval) "interval %d ms"
Expand All @@ -1020,6 +1022,11 @@ displaychangelistener_register(void *dcl, const char *name) "%p [ %s ]"
displaychangelistener_unregister(void *dcl, const char *name) "%p [ %s ]"
ppm_save(const char *filename, void *display_surface) "%s surface=%p"

# ui/gtk.c
gd_switch(int width, int height) "width=%d, height=%d"
gd_update(int x, int y, int w, int h) "x=%d, y=%d, w=%d, h=%d"
gd_key_event(int gdk_keycode, int qemu_keycode, const char *action) "translated GDK keycode %d to QEMU keycode %d (%s)"

# hw/display/vmware_vga.c
vmware_value_read(uint32_t index, uint32_t value) "index %d, value 0x%x"
vmware_value_write(uint32_t index, uint32_t value) "index %d, value 0x%x"
Expand Down

0 comments on commit 783eb67

Please sign in to comment.