static inline void *alloc_code_gen_buffer(void)
{
size_t size = tcg_ctx->code_gen_buffer_size;
- void *buf;
-
- buf = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT,
+ return VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE);
- return buf;
}
#else
static inline void *alloc_code_gen_buffer(void)
static int read_quorum_children(QuorumAIOCB *acb)
{
BDRVQuorumState *s = acb->bs->opaque;
- int i, ret;
+ int i;
acb->children_read = s->num_children;
for (i = 0; i < s->num_children; i++) {
qemu_coroutine_yield();
}
- ret = acb->vote_ret;
-
- return ret;
+ return acb->vote_ret;
}
static int read_fifo_child(QuorumAIOCB *acb)
static uint64_t exynos4210_calc_affinity(int cpu)
{
- uint64_t mp_affinity;
-
/* Exynos4210 has 0x9 as cluster ID */
- mp_affinity = (0x9 << ARM_AFF1_SHIFT) | cpu;
-
- return mp_affinity;
+ return (0x9 << ARM_AFF1_SHIFT) | cpu;
}
Exynos4210State *exynos4210_init(MemoryRegion *system_mem)
Error **errp)
{
VHostUserBlk *s = VHOST_USER_BLK(vdev);
- uint64_t get_features;
/* Turn on pre-defined features */
virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX);
virtio_add_feature(&features, VIRTIO_BLK_F_MQ);
}
- get_features = vhost_get_features(&s->dev, user_feature_bits, features);
-
- return get_features;
+ return vhost_get_features(&s->dev, user_feature_bits, features);
}
static void vhost_user_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)
static int dino_pci_map_irq(PCIDevice *d, int irq_num)
{
int slot = d->devfn >> 3;
- int local_irq;
assert(irq_num >= 0 && irq_num <= 3);
- local_irq = slot & 0x03;
-
- return local_irq;
+ return slot & 0x03;
}
static void dino_set_timer_irq(void *opaque, int irq, int level)
static uint64_t mos6522_get_counter_value(MOS6522State *s, MOS6522Timer *ti)
{
- uint64_t d;
-
- d = muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - ti->load_time,
- ti->frequency, NANOSECONDS_PER_SECOND);
-
- return d;
+ return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - ti->load_time,
+ ti->frequency, NANOSECONDS_PER_SECOND);
}
static uint64_t mos6522_get_load_time(MOS6522State *s, MOS6522Timer *ti)
uint32_t cnt = 1024 * FTGMAC100_APTC_RXPOLL_CNT(s->aptcr);
uint32_t speed = (s->maccr & FTGMAC100_MACCR_FAST_MODE) ? 1 : 0;
- uint32_t period;
if (s->aptcr & FTGMAC100_APTC_RXPOLL_TIME_SEL) {
cnt <<= 4;
speed = 2;
}
- period = cnt / div[speed];
-
- return period;
+ return cnt / div[speed];
}
static void ftgmac100_reset(DeviceState *d)
static bool opb_read(PnvLpcController *lpc, uint32_t addr, uint8_t *data,
int sz)
{
- bool success;
-
/* XXX Handle access size limits and FW read caching here */
- success = !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED,
- data, sz, false);
-
- return success;
+ return !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, sz, false);
}
static bool opb_write(PnvLpcController *lpc, uint32_t addr, uint8_t *data,
int sz)
{
- bool success;
-
/* XXX Handle access size limits here */
- success = !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED,
- data, sz, true);
-
- return success;
+ return !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, sz, true);
}
#define ECCB_CTL_READ PPC_BIT(15)
QIONetListener *qio_net_listener_new(void)
{
- QIONetListener *ret;
-
- ret = QIO_NET_LISTENER(object_new(TYPE_QIO_NET_LISTENER));
-
- return ret;
+ return QIO_NET_LISTENER(object_new(TYPE_QIO_NET_LISTENER));
}
void qio_net_listener_set_name(QIONetListener *listener,
int hax_vcpu_run(struct hax_vcpu_state *vcpu)
{
- int ret;
-
- ret = ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL);
- return ret;
+ return ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL);
}
int hax_sync_fpu(CPUArchState *env, struct fx_layout *fl, int set)
int hax_inject_interrupt(CPUArchState *env, int vector)
{
- int ret, fd;
+ int fd;
fd = hax_vcpu_get_fd(env);
if (fd <= 0) {
return -1;
}
- ret = ioctl(fd, HAX_VCPU_IOCTL_INTERRUPT, &vector);
- return ret;
+ return ioctl(fd, HAX_VCPU_IOCTL_INTERRUPT, &vector);
}
CPUMIPSState *env)
{
uint64_t temp[3];
- target_ulong result;
shift = shift & 0x3F;
mipsdsp_rndrashift_acc(temp, ac, shift, env);
- result = (temp[1] << 63) | (temp[0] >> 1);
-
- return result;
+ return (temp[1] << 63) | (temp[0] >> 1);
}
target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift,
{
uint64_t temp[3];
uint32_t temp128;
- target_ulong result;
shift = shift & 0x3F;
mipsdsp_rndrashift_acc(temp, ac, shift, env);
set_DSPControl_overflow_flag(1, 23, env);
}
- result = (temp[1] << 63) | (temp[0] >> 1);
-
- return result;
+ return (temp[1] << 63) | (temp[0] >> 1);
}
target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift,
{
uint64_t temp[3];
uint32_t temp128;
- target_ulong result;
shift = shift & 0x3F;
mipsdsp_rndrashift_acc(temp, ac, shift, env);
}
set_DSPControl_overflow_flag(1, 23, env);
}
- result = (temp[1] << 63) | (temp[0] >> 1);
-
- return result;
+ return (temp[1] << 63) | (temp[0] >> 1);
}
#endif
static int
Operand_arr_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_ars_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_art_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_ar0_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ar4_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ar8_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ar12_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ars_entry_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_mx_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mw_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr0_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr1_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr2_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr3_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_arr_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_ars_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_art_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_ar0_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ar4_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ar8_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ar12_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_ars_entry_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x1f) != 0;
- return error;
+ return (*valp & ~0x1f) != 0;
}
static int
static int
Operand_mx_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mw_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr0_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr1_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr2_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
Operand_mr3_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3) != 0;
- return error;
+ return (*valp & ~0x3) != 0;
}
static int
static int
OperandSem_opnd_sem_AR_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_0_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_1_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_2_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_3_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_4_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_MR_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 4);
- return error;
+ return (*valp >= 4);
}
static int
static int
OperandSem_opnd_sem_MR_1_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 4);
- return error;
+ return (*valp >= 4);
}
static int
static int
OperandSem_opnd_sem_MR_2_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 4);
- return error;
+ return (*valp >= 4);
}
static int
static int
OperandSem_opnd_sem_MR_3_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 4);
- return error;
+ return (*valp >= 4);
}
static int
static int
OperandSem_opnd_sem_MR_4_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 4);
- return error;
+ return (*valp >= 4);
}
static int
static int
OperandSem_opnd_sem_MR_5_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 4);
- return error;
+ return (*valp >= 4);
}
static int
static int
Operand_arr_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_ars_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_art_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0xf) != 0;
- return error;
+ return (*valp & ~0xf) != 0;
}
static int
static int
Operand_ar0_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3f) != 0;
- return error;
+ return (*valp & ~0x3f) != 0;
}
static int
static int
Operand_ar4_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3f) != 0;
- return error;
+ return (*valp & ~0x3f) != 0;
}
static int
static int
Operand_ar8_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3f) != 0;
- return error;
+ return (*valp & ~0x3f) != 0;
}
static int
static int
Operand_ar12_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3f) != 0;
- return error;
+ return (*valp & ~0x3f) != 0;
}
static int
static int
Operand_ars_entry_encode (uint32 *valp)
{
- int error;
- error = (*valp & ~0x3f) != 0;
- return error;
+ return (*valp & ~0x3f) != 0;
}
static int
static int
OperandSem_opnd_sem_AR_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_0_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_1_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_2_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_3_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
static int
OperandSem_opnd_sem_AR_4_encode (uint32 *valp)
{
- int error;
- error = (*valp >= 32);
- return error;
+ return (*valp >= 32);
}
static int
xtensa_find_opcode_ops(const XtensaOpcodeTranslators *t,
const char *name)
{
- XtensaOpcodeOps *ops;
-
- ops = bsearch(name, t->opcode, t->num_opcodes,
- sizeof(XtensaOpcodeOps), compare_opcode_ops);
- return ops;
+ return bsearch(name, t->opcode, t->num_opcodes,
+ sizeof(XtensaOpcodeOps), compare_opcode_ops);
}
static void translate_abs(DisasContext *dc, const uint32_t arg[],
int main(int argc, char **argv)
{
- int ret;
-
base_setup();
g_test_init(&argc, &argv, NULL);
qtest_add_func("/rtc/bcd-check-time", bcd_check_time);
}
qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
- ret = g_test_run();
-
- return ret;
+ return g_test_run();
}
int main(int argc, char **argv)
{
- int ret;
-
qemu_init_main_loop(&error_abort);
ctx = qemu_get_current_aio_context();
pool = aio_get_thread_pool(ctx);
g_test_add_func("/thread-pool/cancel", test_cancel);
g_test_add_func("/thread-pool/cancel-async", test_cancel_async);
- ret = g_test_run();
-
- return ret;
+ return g_test_run();
}
*/
URI *uri_new(void)
{
- URI *ret;
-
- ret = g_new0(URI, 1);
- return ret;
+ return g_new0(URI, 1);
}
/**