From patchwork Fri Oct 19 05:20:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10648667 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 D2174112B for ; Fri, 19 Oct 2018 05:22:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1DE828928 for ; Fri, 19 Oct 2018 05:22:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B604E28B3C; Fri, 19 Oct 2018 05:22:09 +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 5A01128928 for ; Fri, 19 Oct 2018 05:22:09 +0000 (UTC) Received: from localhost ([::1]:47051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNEe-0004tQ-J0 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Oct 2018 01:22:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNDD-0003kn-Sv for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDNDC-0000Cd-Qz for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:39 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:37117) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDNDB-0008SP-7Y for qemu-devel@nongnu.org; Fri, 19 Oct 2018 01:20:38 -0400 Received: by mail-pf1-x441.google.com with SMTP id j23-v6so15952801pfi.4 for ; Thu, 18 Oct 2018 22:20:30 -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:in-reply-to:references; bh=v8nqSrxq6p2/soPpQJtI3t+myRc39om4RGG5eDPB1IA=; b=I7au/dfpADNCGr1Uxnl//uAUtbG4rElCTMrlcVeHaXGEsitfiEKvloiJBXAd3QHSQ6 rOZCa9Ik1xz/vY63UbS3cOrWtXB9SlaMuPIkm+RM+Z2YnIt8dDbUWwhT+uyXU8PqZB2O IPByiil3/UJ49tKqX9C1IJCV3ZNLFKRThpbSffSJlsO1Th33XCJiGaMzg/4NdibcrpMA VxLw2eiDTdw6jwQ06rPoCfm0mMzUU9TI9nRpoCAI6rwMjIn92fmdlw6p5qu5/m6XijLj 7a448hYfGQzQUX3RmobJAx1OXrZmubFdLbL4pW+vtBWWNUlEA/Ag+rNMO1g4lorZ5kc+ ILLQ== 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:in-reply-to :references; bh=v8nqSrxq6p2/soPpQJtI3t+myRc39om4RGG5eDPB1IA=; b=ZH2Ct0JuXc0hw5BHW9XyynZF3bDMbUqNjcAMgK9HFPWnSMnW9huOJMz/+atD5zOK42 Lz3dIhM2gsVyNcaQQuFxPVPjFT5qivo8ghMlljZWGhmoSrrgoh62MQKjR/Kmd+xeOjW6 EBm7LrzqyU+DGU3l1saYh+PubKZqp8eHVmKGwEdr1jsPrsLSmX1hqp+Mtn4XaNuktRAp YYju4Sq1XvuiMddgG/z/mnG42eZGkW7MeHwfhnXdU2KrF1g8kDXvf4TZDXJ/5xOuXzk9 yG/RDgjwvzRb0YrdJhwKP1Hag22mTHX8IcE0/2qgvATNL8b+rCouhBtpBduDl6lVIE9s K3ig== X-Gm-Message-State: ABuFfoidwpXLkhFfSTtygizhzvwEQlAqcDK400Fh/kzPnrGFQsyGYk90 ZBWkLSn7c5LlwserfkA+SzI= X-Google-Smtp-Source: ACcGV63ImtsZOG0TByV9b2Olrt7vkUF54l62IJ8u7Ht3/im/Gdai5yO1XKlGCEGRRvNRmx3y6zZZeg== X-Received: by 2002:a62:76d8:: with SMTP id r207-v6mr33545117pfc.216.1539926429886; Thu, 18 Oct 2018 22:20:29 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.100]) by smtp.gmail.com with ESMTPSA id p1-v6sm25075191pff.128.2018.10.18.22.20.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 22:20:29 -0700 (PDT) From: Li Qiang To: alex.williamson@redhat.com Date: Thu, 18 Oct 2018 22:20:07 -0700 Message-Id: <1539926412-21831-3-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539926412-21831-1-git-send-email-liq3ea@gmail.com> References: <1539926412-21831-1-git-send-email-liq3ea@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional 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 , philmd@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP As the documentation says "use TYPE_FOO constants" This also changes the parent of ap-device's MACRO. Signed-off-by: Li Qiang --- hw/s390x/ap-device.c | 2 +- hw/vfio/ap.c | 12 ++++++------ include/hw/s390x/ap-device.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/s390x/ap-device.c b/hw/s390x/ap-device.c index f5ac8db..64a5f11 100644 --- a/hw/s390x/ap-device.c +++ b/hw/s390x/ap-device.c @@ -22,7 +22,7 @@ static void ap_class_init(ObjectClass *klass, void *data) } static const TypeInfo ap_device_info = { - .name = AP_DEVICE_TYPE, + .name = TYPE_AP_DEVICE, .parent = TYPE_DEVICE, .instance_size = sizeof(APDevice), .class_size = sizeof(DeviceClass), diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 3962bb7..b332395 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -28,7 +28,7 @@ #include "hw/s390x/ap-bridge.h" #include "exec/address-spaces.h" -#define VFIO_AP_DEVICE_TYPE "vfio-ap" +#define TYPE_VFIO_AP_DEVICE "vfio-ap" typedef struct VFIOAPDevice { APDevice apdev; @@ -36,7 +36,7 @@ typedef struct VFIOAPDevice { } VFIOAPDevice; #define VFIO_AP_DEVICE(obj) \ - OBJECT_CHECK(VFIOAPDevice, (obj), VFIO_AP_DEVICE_TYPE) + OBJECT_CHECK(VFIOAPDevice, (obj), TYPE_VFIO_AP_DEVICE) static void vfio_ap_compute_needs_reset(VFIODevice *vdev) { @@ -69,7 +69,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp) if (!group_path) { error_setg(errp, "%s: no iommu_group found for %s: %s", - VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message); + TYPE_VFIO_AP_DEVICE, vapdev->vdev.sysfsdev, gerror->message); return NULL; } @@ -147,7 +147,7 @@ static void vfio_ap_reset(DeviceState *dev) } static const VMStateDescription vfio_ap_vmstate = { - .name = VFIO_AP_DEVICE_TYPE, + .name = TYPE_VFIO_AP_DEVICE, .unmigratable = 1, }; @@ -167,8 +167,8 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data) } static const TypeInfo vfio_ap_info = { - .name = VFIO_AP_DEVICE_TYPE, - .parent = AP_DEVICE_TYPE, + .name = TYPE_VFIO_AP_DEVICE, + .parent = TYPE_AP_DEVICE, .instance_size = sizeof(VFIOAPDevice), .class_init = vfio_ap_class_init, }; diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h index 765e908..d7eced4 100644 --- a/include/hw/s390x/ap-device.h +++ b/include/hw/s390x/ap-device.h @@ -10,13 +10,13 @@ #ifndef HW_S390X_AP_DEVICE_H #define HW_S390X_AP_DEVICE_H -#define AP_DEVICE_TYPE "ap-device" +#define TYPE_AP_DEVICE "ap-device" typedef struct APDevice { DeviceState parent_obj; } APDevice; #define AP_DEVICE(obj) \ - OBJECT_CHECK(APDevice, (obj), AP_DEVICE_TYPE) + OBJECT_CHECK(APDevice, (obj), TYPE_AP_DEVICE) #endif /* HW_S390X_AP_DEVICE_H */