From patchwork Thu Mar 17 09:06:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhao xiao qiang X-Patchwork-Id: 8608451 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA2019F6E1 for ; Thu, 17 Mar 2016 09:08:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECBCE20279 for ; Thu, 17 Mar 2016 09:08:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 381B9202A1 for ; Thu, 17 Mar 2016 09:08:18 +0000 (UTC) Received: from localhost ([::1]:33544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agTuj-0003eg-Gt for patchwork-qemu-devel@patchwork.kernel.org; Thu, 17 Mar 2016 05:08:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agTuQ-0003ZH-2j for qemu-devel@nongnu.org; Thu, 17 Mar 2016 05:08:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agTuL-0004af-W4 for qemu-devel@nongnu.org; Thu, 17 Mar 2016 05:07:57 -0400 Received: from m12-17.163.com ([220.181.12.17]:49223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agTuL-0004a9-Kc for qemu-devel@nongnu.org; Thu, 17 Mar 2016 05:07:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=9Utsd3HGRojcp8D/uB 9MwEDpallHlLxd2H1ucnayqmY=; b=QyMJcc/NHK+VzfDQon50zb+PcfGesRE2uL Tpg86W1QhLAPtlvUa5svRto0jOG8FLBocE8gIJoeAnipFT0nTb9bTqMStVFhIHl9 XoWLUJzgF/Kil13n3vFGFoIW9lHgMR6PzIepXmEzYtoU60eo1zN62+u0aebUe9yd qzMVhkKJ8= Received: from localhost.localdomain (unknown [118.187.28.42]) by smtp13 (Coremail) with SMTP id EcCowADn0SzUc+pWwyspAw--.30326S4; Thu, 17 Mar 2016 17:07:48 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Thu, 17 Mar 2016 17:06:14 +0800 Message-Id: <1458205576-21646-3-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458205576-21646-1-git-send-email-zxq_yx_007@163.com> References: <1458205576-21646-1-git-send-email-zxq_yx_007@163.com> X-CM-TRANSID: EcCowADn0SzUc+pWwyspAw--.30326S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxZw1DuF4UCw1xWFy3ZF1xuFg_yoWrJFW8pr WxZFyYkF43WFyfGrs7ArsY9a43AryDK3WrKr4rJF4Fkay7Gr98Gr18ZFWIka47CrZakF45 XFsrXayUXa17ur7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07b8YFZUUUUU= X-Originating-IP: [118.187.28.42] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiEAQvxlWBUPVq-AAAsa X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.17 Cc: pbonzini@redhat.com, michael@walle.cc, kraxel@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [RESEND PATCH v2 2/4] hw/audio: QOM cleanup for intel-hda 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drop the DO_UPCAST macro Signed-off-by: xiaoqiang zhao --- hw/audio/intel-hda.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index d372d4a..5b1e760 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -52,8 +52,8 @@ void hda_codec_bus_init(DeviceState *dev, HDACodecBus *bus, size_t bus_size, static int hda_codec_dev_init(DeviceState *qdev) { - HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, qdev->parent_bus); - HDACodecDevice *dev = DO_UPCAST(HDACodecDevice, qdev, qdev); + HDACodecBus *bus = HDA_BUS(qdev->parent_bus); + HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev); HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev); if (dev->cad == -1) { @@ -68,7 +68,7 @@ static int hda_codec_dev_init(DeviceState *qdev) static int hda_codec_dev_exit(DeviceState *qdev) { - HDACodecDevice *dev = DO_UPCAST(HDACodecDevice, qdev, qdev); + HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev); HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev); if (cdc->exit) { @@ -84,7 +84,7 @@ HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint32_t cad) QTAILQ_FOREACH(kid, &bus->qbus.children, sibling) { DeviceState *qdev = kid->child; - cdev = DO_UPCAST(HDACodecDevice, qdev, qdev); + cdev = HDA_CODEC_DEVICE(qdev); if (cdev->cad == cad) { return cdev; } @@ -94,14 +94,14 @@ HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint32_t cad) void hda_codec_response(HDACodecDevice *dev, bool solicited, uint32_t response) { - HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); bus->response(dev, solicited, response); } bool hda_codec_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, uint8_t *buf, uint32_t len) { - HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); return bus->xfer(dev, stnr, output, buf, len); } @@ -337,7 +337,7 @@ static void intel_hda_corb_run(IntelHDAState *d) static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t response) { - HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t wp, ex; @@ -386,7 +386,7 @@ static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t res static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, uint8_t *buf, uint32_t len) { - HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t s, copy, left; @@ -493,7 +493,7 @@ static void intel_hda_notify_codecs(IntelHDAState *d, uint32_t stream, bool runn DeviceState *qdev = kid->child; HDACodecDeviceClass *cdc; - cdev = DO_UPCAST(HDACodecDevice, qdev, qdev); + cdev = HDA_CODEC_DEVICE(qdev); cdc = HDA_CODEC_DEVICE_GET_CLASS(cdev); if (cdc->stream) { cdc->stream(cdev, stream, running, output); @@ -1120,7 +1120,7 @@ static void intel_hda_reset(DeviceState *dev) /* reset codecs */ QTAILQ_FOREACH(kid, &d->codecs.qbus.children, sibling) { DeviceState *qdev = kid->child; - cdev = DO_UPCAST(HDACodecDevice, qdev, qdev); + cdev = HDA_CODEC_DEVICE(qdev); device_reset(DEVICE(cdev)); d->state_sts |= (1 << cdev->cad); }