From patchwork Wed Oct 10 04:29:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10633945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF35F13AD for ; Wed, 10 Oct 2018 04:30:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98ABB29BE1 for ; Wed, 10 Oct 2018 04:30:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AD1E29C37; Wed, 10 Oct 2018 04:30:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id D6A9029BE1 for ; Wed, 10 Oct 2018 04:30:19 +0000 (UTC) Received: from localhost ([::1]:54765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA68Y-0007iX-Le for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Oct 2018 00:30:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA67u-0007PK-FD for qemu-devel@nongnu.org; Wed, 10 Oct 2018 00:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA67t-0000j3-Ok for qemu-devel@nongnu.org; Wed, 10 Oct 2018 00:29:38 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:34358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gA67n-0000c8-Oh; Wed, 10 Oct 2018 00:29:31 -0400 Received: by mail-pl1-x641.google.com with SMTP id f18-v6so1887726plr.1; Tue, 09 Oct 2018 21:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GmnizY9ciplQJktNUKO6UDIb8NXWdAIQmBOYfYQt3O4=; b=jvW49b9tn5nz00fIBqIGF2U8qfYVcLNqS9zl6LK/na9uXoneLDsrorIzgahSByp+bz EJkhHkvJSzOoMCkx/VLou9+45Z3hfgZapQPOjlBpd5tVitshNTjld+h+aTGyXbijuttS b5j7JWQl7tT2CC87ATKklFbxE56aWgJmC/8h+aZ1q8RcHDkOE33eiQgYGfkkj4qzHYhs Y+D4EbnFp1TF58YJBlJRK3rcERc1ZZyukpinTHVAwBx7ZrZSBvA4bUKgdLxg7OcDYW4p BLh2lSlXipPw+cY/Pd05pvXO5yBAorI/W3RW+Ys1qj4rK+mMUs/oy3htBiyEH0zknVrx zC+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GmnizY9ciplQJktNUKO6UDIb8NXWdAIQmBOYfYQt3O4=; b=MzSRzZZemU9Z+IiUKlDjw6wnN10QdigzjM9sog4pm/0iiwBY4WSykKc2hTlM2yrDDp se+tkZMhk0Q2gZWvNxighQfoh9XacV1cvxk5Hx3r328/arFrpIZxVgFtuaCLVavtuhFJ SVuxhWuRc2rgXt19eLRC/MUGUdbwhtiRYTDFs6yrIoDeV+yBT7BC8IAEy/rTkCggse2c n0VXPJU01g/UqDPOMt2RodCe8B2cyWTgr95CfLABVNSpc2evnfrQY3Kyhp3Y27PnMP6T XNKPLcyl7qGiIlxP5MTPLkYFy6vV34TvduAh3YnktVnb4ggORN7oimkdbIbL3y67lH1S oy2A== X-Gm-Message-State: ABuFfohf2PmzuD5j/9WOEn+Aw/IMMhkDwCRS9b2xlndgnMrUMHgAQr76 pmsu9n+gvYboLRz/64qWpPg= X-Google-Smtp-Source: ACcGV61FhKDnKuYNxTel4zeKz+5N6eB/Ir3B1KRTPEm9Jvlsg1zasz4D3PKrh+bARqDHhL0yM6vjzQ== X-Received: by 2002:a17:902:b03:: with SMTP id 3-v6mr23881875plq.141.1539145768766; Tue, 09 Oct 2018 21:29:28 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.101]) by smtp.gmail.com with ESMTPSA id g65-v6sm37466154pfg.98.2018.10.09.21.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 21:29:28 -0700 (PDT) From: Li Qiang To: jsnow@redhat.com Date: Tue, 9 Oct 2018 21:29:24 -0700 Message-Id: <1539145764-5730-1-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 Subject: [Qemu-devel] [PATCH] ide: piix: convert constant device name to MACRO 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: Li Qiang , qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Li Qiang Reviewed-by: John Snow Acked-by: John Snow --- hw/ide/piix.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a3afe1f..5f29cce 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -35,6 +35,10 @@ #include "hw/ide/pci.h" #include "trace.h" +#define TYPE_PIIX3_IDE "piix3-ide" +#define TYPE_PIIX3_IDE_XEN "piix3-ide-xen" +#define TYPE_PIIX4_IDE "piix4-ide" + static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size) { BMDMAState *bm = opaque; @@ -204,7 +208,7 @@ PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) { PCIDevice *dev; - dev = pci_create_simple(bus, devfn, "piix3-ide-xen"); + dev = pci_create_simple(bus, devfn, TYPE_PIIX3_IDE_XEN); pci_ide_create_devs(dev, hd_table); return dev; } @@ -226,7 +230,7 @@ PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) { PCIDevice *dev; - dev = pci_create_simple(bus, devfn, "piix3-ide"); + dev = pci_create_simple(bus, devfn, TYPE_PIIX3_IDE); pci_ide_create_devs(dev, hd_table); return dev; } @@ -237,7 +241,7 @@ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) { PCIDevice *dev; - dev = pci_create_simple(bus, devfn, "piix4-ide"); + dev = pci_create_simple(bus, devfn, TYPE_PIIX4_IDE); pci_ide_create_devs(dev, hd_table); return dev; } @@ -257,13 +261,13 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) } static const TypeInfo piix3_ide_info = { - .name = "piix3-ide", + .name = TYPE_PIIX3_IDE, .parent = TYPE_PCI_IDE, .class_init = piix3_ide_class_init, }; static const TypeInfo piix3_ide_xen_info = { - .name = "piix3-ide-xen", + .name = TYPE_PIIX3_IDE_XEN, .parent = TYPE_PCI_IDE, .class_init = piix3_ide_class_init, }; @@ -283,7 +287,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) } static const TypeInfo piix4_ide_info = { - .name = "piix4-ide", + .name = TYPE_PIIX4_IDE, .parent = TYPE_PCI_IDE, .class_init = piix4_ide_class_init, };