From patchwork Thu Oct 12 11:21:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 824792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yCT416D43z9sBd for ; Thu, 12 Oct 2017 22:23:11 +1100 (AEDT) Received: from localhost ([::1]:44817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2ba0-0006BF-BY for incoming@patchwork.ozlabs.org; Thu, 12 Oct 2017 07:23:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2bZT-0006BA-S5 for qemu-devel@nongnu.org; Thu, 12 Oct 2017 07:22:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2bZQ-0005Nl-JX for qemu-devel@nongnu.org; Thu, 12 Oct 2017 07:22:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40586) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2bZQ-0005Fs-BC for qemu-devel@nongnu.org; Thu, 12 Oct 2017 07:22:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 664E0C04AC4A for ; Thu, 12 Oct 2017 11:22:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 664E0C04AC4A Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com Received: from localhost (ovpn-112-25.ams2.redhat.com [10.36.112.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6A3418A6A; Thu, 12 Oct 2017 11:22:17 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 13:21:57 +0200 Message-Id: <20171012112157.15647-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 12 Oct 2017 11:22:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] usb-ccid: remove needless migration state code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , kraxel@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This code appears to be unused since its introduction. It should be safe to remove from VMState. Signed-off-by: Marc-André Lureau --- hw/usb/dev-smartcard-reader.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 0c77d2a41d..d23a4d7f7d 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -270,11 +270,6 @@ typedef struct BulkIn { uint32_t pos; } BulkIn; -enum { - MIGRATION_NONE, - MIGRATION_MIGRATED, -}; - typedef struct CCIDBus { BusState qbus; } CCIDBus; @@ -306,9 +301,6 @@ typedef struct USBCCIDState { CCID_ProtocolDataStructure abProtocolDataStructure; uint32_t ulProtocolDataStructureSize; uint32_t state_vmstate; - uint32_t migration_target_ip; - uint16_t migration_target_port; - uint8_t migration_state; uint8_t bmSlotICCState; uint8_t powered; uint8_t notify_slot_change; @@ -1243,9 +1235,6 @@ int ccid_card_ccid_attach(CCIDCardState *card) USBCCIDState *s = USB_CCID_DEV(dev); DPRINTF(s, 1, "CCID Attach\n"); - if (s->migration_state == MIGRATION_MIGRATED) { - s->migration_state = MIGRATION_NONE; - } return 0; } @@ -1341,9 +1330,6 @@ static void ccid_realize(USBDevice *dev, Error **errp) s->intr = usb_ep_get(dev, USB_TOKEN_IN, CCID_INT_IN_EP); s->bulk = usb_ep_get(dev, USB_TOKEN_IN, CCID_BULK_IN_EP); s->card = NULL; - s->migration_state = MIGRATION_NONE; - s->migration_target_ip = 0; - s->migration_target_port = 0; s->dev.speed = USB_SPEED_FULL; s->dev.speedmask = USB_SPEED_MASK_FULL; s->notify_slot_change = false; @@ -1379,13 +1365,6 @@ static int ccid_pre_save(void *opaque) USBCCIDState *s = opaque; s->state_vmstate = s->dev.state; - if (s->dev.attached) { - /* - * Migrating an open device, ignore reconnection CHR_EVENT to avoid an - * erroneous detach. - */ - s->migration_state = MIGRATION_MIGRATED; - } return 0; } @@ -1452,7 +1431,6 @@ static VMStateDescription ccid_vmstate = { VMSTATE_STRUCT_ARRAY(pending_answers, USBCCIDState, PENDING_ANSWERS_NUM, 1, answer_vmstate, Answer), VMSTATE_UINT32(pending_answers_num, USBCCIDState), - VMSTATE_UINT8(migration_state, USBCCIDState), VMSTATE_UINT32(state_vmstate, USBCCIDState), VMSTATE_END_OF_LIST() }