From patchwork Tue Jun 25 14:14:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 254160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DE1122C0087 for ; Wed, 26 Jun 2013 00:16:12 +1000 (EST) Received: from localhost ([::1]:37409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrU2U-00044D-QF for incoming@patchwork.ozlabs.org; Tue, 25 Jun 2013 10:16:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrU1c-0003vZ-3z for qemu-devel@nongnu.org; Tue, 25 Jun 2013 10:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrU1a-0002hc-Fo for qemu-devel@nongnu.org; Tue, 25 Jun 2013 10:15:16 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:64404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrU1a-0002hO-6T for qemu-devel@nongnu.org; Tue, 25 Jun 2013 10:15:14 -0400 Received: by mail-ea0-f171.google.com with SMTP id m14so6889883eaj.30 for ; Tue, 25 Jun 2013 07:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=kyTRxGbQ14OPGeGll/eD30+n1Q8lscwbP4RqymuvjWo=; b=SEyuicuNRkC0vehZOD6gVxmSH4U+CjTuGeabYM8iA24+qZm8tZGCbrQTpaWCm2LUHV NkU1ZaH+XCVkri0PuNXvXBIZcfRBhrHB6fq/K7V3+mCg2vPcsvDkSKjRtOcccNZGDCIr 0qHbCei2CkZLUB+xHCiqyv+wmcMfw0jZ84RHVpch4WMTU3c65BOdR6tW2pfNJbEmc6J1 CV4nhJRbkbI4/galCBBntagrEoJ9VLOjhsv+JF7LRUfTTnGlTJhGdXOO0MLDNQ2gegCj 6j+YFEmEK6E8zi4lHJ+g4lUo9F1se8Hfy8qcKlY0VwwKzewuTTzFekOZnvtbslaq+utm Ovzg== X-Received: by 10.14.216.73 with SMTP id f49mr29912120eep.119.1372169713461; Tue, 25 Jun 2013 07:15:13 -0700 (PDT) Received: from playground.lan (net-37-116-217-184.cust.dsl.vodafone.it. [37.116.217.184]) by mx.google.com with ESMTPSA id n5sm36251649eed.9.2013.06.25.07.15.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Jun 2013 07:15:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2013 16:14:42 +0200 Message-Id: <1372169705-7645-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372169705-7645-1-git-send-email-pbonzini@redhat.com> References: <1372169705-7645-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22b Cc: peter.maydell@linaro.org, alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH 01/24] escc: rename struct to ESCCState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We are using the same struct name for two devices. 8250 is widespread enough that this causes some confusion, rename the other instance. Signed-off-by: Paolo Bonzini Reviewed-by: Andreas Färber --- hw/char/escc.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 29ecbaa..422adf2 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -96,14 +96,14 @@ typedef struct ChannelState { uint8_t rx, tx; } ChannelState; -struct SerialState { +typedef struct ESCCState { SysBusDevice busdev; struct ChannelState chn[2]; uint32_t it_shift; MemoryRegion mmio; uint32_t disabled; uint32_t frequency; -}; +} ESCCState; #define SERIAL_CTRL 0 #define SERIAL_DATA 1 @@ -309,7 +309,7 @@ static void escc_reset_chn(ChannelState *s) static void escc_reset(DeviceState *d) { - SerialState *s = container_of(d, SerialState, busdev.qdev); + ESCCState *s = container_of(d, ESCCState, busdev.qdev); escc_reset_chn(&s->chn[0]); escc_reset_chn(&s->chn[1]); @@ -466,7 +466,7 @@ static void escc_update_parameters(ChannelState *s) static void escc_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - SerialState *serial = opaque; + ESCCState *serial = opaque; ChannelState *s; uint32_t saddr; int newreg, channel; @@ -568,7 +568,7 @@ static void escc_mem_write(void *opaque, hwaddr addr, static uint64_t escc_mem_read(void *opaque, hwaddr addr, unsigned size) { - SerialState *serial = opaque; + ESCCState *serial = opaque; ChannelState *s; uint32_t saddr; uint32_t ret; @@ -677,7 +677,7 @@ static const VMStateDescription vmstate_escc = { .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField []) { - VMSTATE_STRUCT_ARRAY(chn, SerialState, 2, 2, vmstate_escc_chn, + VMSTATE_STRUCT_ARRAY(chn, ESCCState, 2, 2, vmstate_escc_chn, ChannelState), VMSTATE_END_OF_LIST() } @@ -689,7 +689,7 @@ MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB, { DeviceState *dev; SysBusDevice *s; - SerialState *d; + ESCCState *d; dev = qdev_create(NULL, "escc"); qdev_prop_set_uint32(dev, "disabled", 0); @@ -707,7 +707,7 @@ MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB, sysbus_mmio_map(s, 0, base); } - d = FROM_SYSBUS(SerialState, s); + d = FROM_SYSBUS(ESCCState, s); return &d->mmio; } @@ -869,7 +869,7 @@ void slavio_serial_ms_kbd_init(hwaddr base, qemu_irq irq, static int escc_init1(SysBusDevice *dev) { - SerialState *s = FROM_SYSBUS(SerialState, dev); + ESCCState *s = FROM_SYSBUS(ESCCState, dev); unsigned int i; s->chn[0].disabled = s->disabled; @@ -902,13 +902,13 @@ static int escc_init1(SysBusDevice *dev) } static Property escc_properties[] = { - DEFINE_PROP_UINT32("frequency", SerialState, frequency, 0), - DEFINE_PROP_UINT32("it_shift", SerialState, it_shift, 0), - DEFINE_PROP_UINT32("disabled", SerialState, disabled, 0), - DEFINE_PROP_UINT32("chnBtype", SerialState, chn[0].type, 0), - DEFINE_PROP_UINT32("chnAtype", SerialState, chn[1].type, 0), - DEFINE_PROP_CHR("chrB", SerialState, chn[0].chr), - DEFINE_PROP_CHR("chrA", SerialState, chn[1].chr), + DEFINE_PROP_UINT32("frequency", ESCCState, frequency, 0), + DEFINE_PROP_UINT32("it_shift", ESCCState, it_shift, 0), + DEFINE_PROP_UINT32("disabled", ESCCState, disabled, 0), + DEFINE_PROP_UINT32("chnBtype", ESCCState, chn[0].type, 0), + DEFINE_PROP_UINT32("chnAtype", ESCCState, chn[1].type, 0), + DEFINE_PROP_CHR("chrB", ESCCState, chn[0].chr), + DEFINE_PROP_CHR("chrA", ESCCState, chn[1].chr), DEFINE_PROP_END_OF_LIST(), }; @@ -926,7 +926,7 @@ static void escc_class_init(ObjectClass *klass, void *data) static const TypeInfo escc_info = { .name = "escc", .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(SerialState), + .instance_size = sizeof(ESCCState), .class_init = escc_class_init, };