mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 03:29:43 +00:00
Remove superfluous timer_del() calls
This commit is the result of running the timer-del-timer-free.cocci script on the whole source tree. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Corey Minyard <cminyard@mvista.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201215154107.3255-4-peter.maydell@linaro.org
This commit is contained in:
parent
01b3e68bb1
commit
729cc68373
@ -1524,12 +1524,10 @@ static void iscsi_detach_aio_context(BlockDriverState *bs)
|
||||
iscsilun->events = 0;
|
||||
|
||||
if (iscsilun->nop_timer) {
|
||||
timer_del(iscsilun->nop_timer);
|
||||
timer_free(iscsilun->nop_timer);
|
||||
iscsilun->nop_timer = NULL;
|
||||
}
|
||||
if (iscsilun->event_timer) {
|
||||
timer_del(iscsilun->event_timer);
|
||||
timer_free(iscsilun->event_timer);
|
||||
iscsilun->event_timer = NULL;
|
||||
}
|
||||
|
@ -194,7 +194,6 @@ static void nbd_recv_coroutines_wake_all(BDRVNBDState *s)
|
||||
static void reconnect_delay_timer_del(BDRVNBDState *s)
|
||||
{
|
||||
if (s->reconnect_delay_timer) {
|
||||
timer_del(s->reconnect_delay_timer);
|
||||
timer_free(s->reconnect_delay_timer);
|
||||
s->reconnect_delay_timer = NULL;
|
||||
}
|
||||
|
@ -852,7 +852,6 @@ static void cache_clean_timer_del(BlockDriverState *bs)
|
||||
{
|
||||
BDRVQcow2State *s = bs->opaque;
|
||||
if (s->cache_clean_timer) {
|
||||
timer_del(s->cache_clean_timer);
|
||||
timer_free(s->cache_clean_timer);
|
||||
s->cache_clean_timer = NULL;
|
||||
}
|
||||
|
@ -1052,7 +1052,6 @@ static uint16_t nvme_io_cmd(NvmeCtrl *n, NvmeRequest *req)
|
||||
static void nvme_free_sq(NvmeSQueue *sq, NvmeCtrl *n)
|
||||
{
|
||||
n->sq[sq->sqid] = NULL;
|
||||
timer_del(sq->timer);
|
||||
timer_free(sq->timer);
|
||||
g_free(sq->io_req);
|
||||
if (sq->sqid) {
|
||||
@ -1334,7 +1333,6 @@ static uint16_t nvme_get_log(NvmeCtrl *n, NvmeRequest *req)
|
||||
static void nvme_free_cq(NvmeCQueue *cq, NvmeCtrl *n)
|
||||
{
|
||||
n->cq[cq->cqid] = NULL;
|
||||
timer_del(cq->timer);
|
||||
timer_free(cq->timer);
|
||||
msix_vector_unuse(&n->parent_obj, cq->vector);
|
||||
if (cq->cqid) {
|
||||
|
@ -941,10 +941,8 @@ static void serial_unrealize(DeviceState *dev)
|
||||
|
||||
qemu_chr_fe_deinit(&s->chr, false);
|
||||
|
||||
timer_del(s->modem_status_poll);
|
||||
timer_free(s->modem_status_poll);
|
||||
|
||||
timer_del(s->fifo_timeout_timer);
|
||||
timer_free(s->fifo_timeout_timer);
|
||||
|
||||
fifo8_destroy(&s->recv_fifo);
|
||||
|
@ -741,7 +741,6 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
|
||||
}
|
||||
}
|
||||
g_free(s->post_load->connected);
|
||||
timer_del(s->post_load->timer);
|
||||
timer_free(s->post_load->timer);
|
||||
g_free(s->post_load);
|
||||
s->post_load = NULL;
|
||||
@ -1138,7 +1137,6 @@ static void virtio_serial_device_unrealize(DeviceState *dev)
|
||||
g_free(vser->ports_map);
|
||||
if (vser->post_load) {
|
||||
g_free(vser->post_load->connected);
|
||||
timer_del(vser->post_load->timer);
|
||||
timer_free(vser->post_load->timer);
|
||||
g_free(vser->post_load);
|
||||
}
|
||||
|
@ -2716,7 +2716,6 @@ void ide_init2(IDEBus *bus, qemu_irq irq)
|
||||
|
||||
void ide_exit(IDEState *s)
|
||||
{
|
||||
timer_del(s->sector_write_timer);
|
||||
timer_free(s->sector_write_timer);
|
||||
qemu_vfree(s->smart_selftest_data);
|
||||
qemu_vfree(s->io_buffer);
|
||||
|
@ -88,7 +88,6 @@ static void hid_idle_timer(void *opaque)
|
||||
static void hid_del_idle_timer(HIDState *hs)
|
||||
{
|
||||
if (hs->idle_timer) {
|
||||
timer_del(hs->idle_timer);
|
||||
timer_free(hs->idle_timer);
|
||||
hs->idle_timer = NULL;
|
||||
}
|
||||
|
@ -888,7 +888,6 @@ static void apic_unrealize(DeviceState *dev)
|
||||
{
|
||||
APICCommonState *s = APIC(dev);
|
||||
|
||||
timer_del(s->timer);
|
||||
timer_free(s->timer);
|
||||
local_apics[s->id] = NULL;
|
||||
}
|
||||
|
@ -474,7 +474,6 @@ static void ioapic_unrealize(DeviceState *dev)
|
||||
{
|
||||
IOAPICCommonState *s = IOAPIC_COMMON(dev);
|
||||
|
||||
timer_del(s->delayed_ioapic_service_timer);
|
||||
timer_free(s->delayed_ioapic_service_timer);
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,6 @@ static void ipmi_bmc_extern_finalize(Object *obj)
|
||||
{
|
||||
IPMIBmcExtern *ibe = IPMI_BMC_EXTERN(obj);
|
||||
|
||||
timer_del(ibe->extern_timer);
|
||||
timer_free(ibe->extern_timer);
|
||||
}
|
||||
|
||||
|
@ -1647,11 +1647,8 @@ pci_e1000_uninit(PCIDevice *dev)
|
||||
{
|
||||
E1000State *d = E1000(dev);
|
||||
|
||||
timer_del(d->autoneg_timer);
|
||||
timer_free(d->autoneg_timer);
|
||||
timer_del(d->mit_timer);
|
||||
timer_free(d->mit_timer);
|
||||
timer_del(d->flush_queue_timer);
|
||||
timer_free(d->flush_queue_timer);
|
||||
qemu_del_nic(d->nic);
|
||||
}
|
||||
|
@ -434,23 +434,16 @@ e1000e_intrmgr_pci_unint(E1000ECore *core)
|
||||
{
|
||||
int i;
|
||||
|
||||
timer_del(core->radv.timer);
|
||||
timer_free(core->radv.timer);
|
||||
timer_del(core->rdtr.timer);
|
||||
timer_free(core->rdtr.timer);
|
||||
timer_del(core->raid.timer);
|
||||
timer_free(core->raid.timer);
|
||||
|
||||
timer_del(core->tadv.timer);
|
||||
timer_free(core->tadv.timer);
|
||||
timer_del(core->tidv.timer);
|
||||
timer_free(core->tidv.timer);
|
||||
|
||||
timer_del(core->itr.timer);
|
||||
timer_free(core->itr.timer);
|
||||
|
||||
for (i = 0; i < E1000E_MSIX_VEC_NUM; i++) {
|
||||
timer_del(core->eitr[i].timer);
|
||||
timer_free(core->eitr[i].timer);
|
||||
}
|
||||
}
|
||||
@ -3355,7 +3348,6 @@ e1000e_core_pci_uninit(E1000ECore *core)
|
||||
{
|
||||
int i;
|
||||
|
||||
timer_del(core->autoneg_timer);
|
||||
timer_free(core->autoneg_timer);
|
||||
|
||||
e1000e_intrmgr_pci_unint(core);
|
||||
|
@ -183,7 +183,6 @@ static void pci_pcnet_uninit(PCIDevice *dev)
|
||||
PCIPCNetState *d = PCI_PCNET(dev);
|
||||
|
||||
qemu_free_irq(d->state.irq);
|
||||
timer_del(d->state.poll_timer);
|
||||
timer_free(d->state.poll_timer);
|
||||
qemu_del_nic(d->state.nic);
|
||||
}
|
||||
|
@ -3338,7 +3338,6 @@ static void pci_rtl8139_uninit(PCIDevice *dev)
|
||||
|
||||
g_free(s->cplus_txbuffer);
|
||||
s->cplus_txbuffer = NULL;
|
||||
timer_del(s->timer);
|
||||
timer_free(s->timer);
|
||||
qemu_del_nic(s->nic);
|
||||
}
|
||||
|
@ -363,7 +363,6 @@ static void spapr_vlan_instance_finalize(Object *obj)
|
||||
}
|
||||
|
||||
if (dev->rxp_timer) {
|
||||
timer_del(dev->rxp_timer);
|
||||
timer_free(dev->rxp_timer);
|
||||
}
|
||||
}
|
||||
|
@ -1862,7 +1862,6 @@ static void virtio_net_rsc_cleanup(VirtIONet *n)
|
||||
g_free(seg);
|
||||
}
|
||||
|
||||
timer_del(chain->drain_timer);
|
||||
timer_free(chain->drain_timer);
|
||||
QTAILQ_REMOVE(&n->rsc_chains, chain, next);
|
||||
g_free(chain);
|
||||
@ -2645,7 +2644,6 @@ static void virtio_net_del_queue(VirtIONet *n, int index)
|
||||
|
||||
virtio_del_queue(vdev, index * 2);
|
||||
if (q->tx_timer) {
|
||||
timer_del(q->tx_timer);
|
||||
timer_free(q->tx_timer);
|
||||
q->tx_timer = NULL;
|
||||
} else {
|
||||
|
@ -955,7 +955,6 @@ void pci_dereg_ioat(S390PCIIOMMU *iommu)
|
||||
void fmb_timer_free(S390PCIBusDevice *pbdev)
|
||||
{
|
||||
if (pbdev->fmb_timer) {
|
||||
timer_del(pbdev->fmb_timer);
|
||||
timer_free(pbdev->fmb_timer);
|
||||
pbdev->fmb_timer = NULL;
|
||||
}
|
||||
|
@ -2133,7 +2133,6 @@ static void sd_instance_finalize(Object *obj)
|
||||
{
|
||||
SDState *sd = SD_CARD(obj);
|
||||
|
||||
timer_del(sd->ocr_power_timer);
|
||||
timer_free(sd->ocr_power_timer);
|
||||
}
|
||||
|
||||
|
@ -1330,9 +1330,7 @@ void sdhci_initfn(SDHCIState *s)
|
||||
|
||||
void sdhci_uninitfn(SDHCIState *s)
|
||||
{
|
||||
timer_del(s->insert_timer);
|
||||
timer_free(s->insert_timer);
|
||||
timer_del(s->transfer_timer);
|
||||
timer_free(s->transfer_timer);
|
||||
|
||||
g_free(s->fifo_buffer);
|
||||
|
@ -576,7 +576,6 @@ static void usb_hub_unrealize(USBDevice *dev)
|
||||
&s->ports[i].port);
|
||||
}
|
||||
|
||||
timer_del(s->port_timer);
|
||||
timer_free(s->port_timer);
|
||||
}
|
||||
|
||||
|
@ -2534,7 +2534,6 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *dev)
|
||||
trace_usb_ehci_unrealize();
|
||||
|
||||
if (s->frame_timer) {
|
||||
timer_del(s->frame_timer);
|
||||
timer_free(s->frame_timer);
|
||||
s->frame_timer = NULL;
|
||||
}
|
||||
|
@ -97,7 +97,6 @@ static void usb_ohci_exit(PCIDevice *dev)
|
||||
usb_bus_release(&s->bus);
|
||||
}
|
||||
|
||||
timer_del(s->eof_timer);
|
||||
timer_free(s->eof_timer);
|
||||
}
|
||||
|
||||
|
@ -1283,7 +1283,6 @@ static void usb_uhci_exit(PCIDevice *dev)
|
||||
trace_usb_uhci_exit();
|
||||
|
||||
if (s->frame_timer) {
|
||||
timer_del(s->frame_timer);
|
||||
timer_free(s->frame_timer);
|
||||
s->frame_timer = NULL;
|
||||
}
|
||||
|
@ -3395,7 +3395,6 @@ static void usb_xhci_unrealize(DeviceState *dev)
|
||||
}
|
||||
|
||||
if (xhci->mfwrap_timer) {
|
||||
timer_del(xhci->mfwrap_timer);
|
||||
timer_free(xhci->mfwrap_timer);
|
||||
xhci->mfwrap_timer = NULL;
|
||||
}
|
||||
|
@ -1481,7 +1481,6 @@ static void usbredir_unrealize(USBDevice *udev)
|
||||
qemu_bh_delete(dev->chardev_close_bh);
|
||||
qemu_bh_delete(dev->device_reject_bh);
|
||||
|
||||
timer_del(dev->attach_timer);
|
||||
timer_free(dev->attach_timer);
|
||||
|
||||
usbredir_cleanup_device_queues(dev);
|
||||
|
@ -186,7 +186,6 @@ static void vfio_display_edid_exit(VFIODisplay *dpy)
|
||||
|
||||
g_free(dpy->edid_regs);
|
||||
g_free(dpy->edid_blob);
|
||||
timer_del(dpy->edid_link_timer);
|
||||
timer_free(dpy->edid_link_timer);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,6 @@ static void vhost_vsock_common_post_load_timer_cleanup(VHostVSockCommon *vvc)
|
||||
return;
|
||||
}
|
||||
|
||||
timer_del(vvc->post_load_timer);
|
||||
timer_free(vvc->post_load_timer);
|
||||
vvc->post_load_timer = NULL;
|
||||
}
|
||||
|
@ -204,7 +204,6 @@ static bool balloon_stats_enabled(const VirtIOBalloon *s)
|
||||
static void balloon_stats_destroy_timer(VirtIOBalloon *s)
|
||||
{
|
||||
if (balloon_stats_enabled(s)) {
|
||||
timer_del(s->stats_timer);
|
||||
timer_free(s->stats_timer);
|
||||
s->stats_timer = NULL;
|
||||
s->stats_poll_interval = 0;
|
||||
|
@ -233,7 +233,6 @@ static void virtio_rng_device_unrealize(DeviceState *dev)
|
||||
VirtIORNG *vrng = VIRTIO_RNG(dev);
|
||||
|
||||
qemu_del_vm_change_state_handler(vrng->vmstate);
|
||||
timer_del(vrng->rate_limit_timer);
|
||||
timer_free(vrng->rate_limit_timer);
|
||||
virtio_del_queue(vdev, 0);
|
||||
virtio_cleanup(vdev);
|
||||
|
@ -110,7 +110,6 @@ static void wdt_diag288_unrealize(DeviceState *dev)
|
||||
{
|
||||
DIAG288State *diag288 = DIAG288(dev);
|
||||
|
||||
timer_del(diag288->timer);
|
||||
timer_free(diag288->timer);
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,6 @@ static void i6300esb_exit(PCIDevice *dev)
|
||||
{
|
||||
I6300State *d = WATCHDOG_I6300ESB_DEVICE(dev);
|
||||
|
||||
timer_del(d->timer);
|
||||
timer_free(d->timer);
|
||||
}
|
||||
|
||||
|
@ -636,7 +636,6 @@ out:
|
||||
* error.
|
||||
*/
|
||||
colo_compare_unregister_notifier(&packets_compare_notifier);
|
||||
timer_del(s->colo_delay_timer);
|
||||
timer_free(s->colo_delay_timer);
|
||||
qemu_event_destroy(&s->colo_checkpoint_event);
|
||||
|
||||
|
@ -1586,7 +1586,6 @@ static void hmp_migrate_status_cb(void *opaque)
|
||||
error_report("%s", info->error_desc);
|
||||
}
|
||||
monitor_resume(status->mon);
|
||||
timer_del(status->timer);
|
||||
timer_free(status->timer);
|
||||
g_free(status);
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ void qemu_announce_timer_del(AnnounceTimer *timer, bool free_named)
|
||||
{
|
||||
bool free_timer = false;
|
||||
if (timer->tm) {
|
||||
timer_del(timer->tm);
|
||||
timer_free(timer->tm);
|
||||
timer->tm = NULL;
|
||||
}
|
||||
|
@ -951,7 +951,6 @@ static void colo_compare_timer_init(CompareState *s)
|
||||
static void colo_compare_timer_del(CompareState *s)
|
||||
{
|
||||
if (s->packet_check_timer) {
|
||||
timer_del(s->packet_check_timer);
|
||||
timer_free(s->packet_check_timer);
|
||||
s->packet_check_timer = NULL;
|
||||
}
|
||||
|
@ -184,7 +184,6 @@ static void *net_slirp_timer_new(SlirpTimerCb cb,
|
||||
|
||||
static void net_slirp_timer_free(void *timer, void *opaque)
|
||||
{
|
||||
timer_del(timer);
|
||||
timer_free(timer);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,6 @@ static void replay_delete_break(void)
|
||||
assert(replay_mutex_locked());
|
||||
|
||||
if (replay_break_timer) {
|
||||
timer_del(replay_break_timer);
|
||||
timer_free(replay_break_timer);
|
||||
replay_break_timer = NULL;
|
||||
}
|
||||
|
@ -313,9 +313,7 @@ static void s390_cpu_finalize(Object *obj)
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
S390CPU *cpu = S390_CPU(obj);
|
||||
|
||||
timer_del(cpu->env.tod_timer);
|
||||
timer_free(cpu->env.tod_timer);
|
||||
timer_del(cpu->env.cpu_timer);
|
||||
timer_free(cpu->env.cpu_timer);
|
||||
|
||||
qemu_unregister_reset(s390_cpu_machine_reset_cb, cpu);
|
||||
|
@ -253,7 +253,6 @@ static void gui_setup_refresh(DisplayState *ds)
|
||||
timer_mod(ds->gui_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME));
|
||||
}
|
||||
if (!need_timer && ds->gui_timer != NULL) {
|
||||
timer_del(ds->gui_timer);
|
||||
timer_free(ds->gui_timer);
|
||||
ds->gui_timer = NULL;
|
||||
}
|
||||
|
@ -76,7 +76,6 @@ static void timer_cancel(SpiceTimer *timer)
|
||||
|
||||
static void timer_remove(SpiceTimer *timer)
|
||||
{
|
||||
timer_del(timer->timer);
|
||||
timer_free(timer->timer);
|
||||
g_free(timer);
|
||||
}
|
||||
|
@ -247,7 +247,6 @@ static void throttle_timer_destroy(QEMUTimer **timer)
|
||||
{
|
||||
assert(*timer != NULL);
|
||||
|
||||
timer_del(*timer);
|
||||
timer_free(*timer);
|
||||
*timer = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user