From nobody Sat Nov 15 19:04:47 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596656944; cv=none; d=zohomail.com; s=zohoarc; b=ap9pVz9aGh5ZYLp0wcEGoIcSQLckjjh/u8FLV336u0aVVeqJf7uhZSFFxKtYOpitwd4hZYq1hLrxfDmii+pumBSwR9dbLDovHAd9LX/esQruXTdQ5S4oFJxnBqN5F3oubFTlnE1n8eu5lxwLcd0gvM3+fEvVUgEtL6E1q9mtoOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596656944; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Ua8vzGT2EBSgdeNzQOoLqmsEH3spXT1WCJ+PlW9rv0g=; b=bkHaRcAcoLcfKRCOgVHxoI8Wz4TJPqcjdNX/wXqAnYVXDNyEFhze7F52lRH6GiLpgBAj5X4sezoopRMLhFDMRFnZAzxFabWO6bq6uxl46Rdnh1XbJohrG9yzU0/pFGiJu1tfd5b74m0yiZV7X2hA3bulayZOhmN0X//2lEXpqN0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596656944512324.3381099433085; Wed, 5 Aug 2020 12:49:04 -0700 (PDT) Received: from localhost ([::1]:42934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3PPK-0003zf-3k for importer@patchew.org; Wed, 05 Aug 2020 15:49:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3POj-0003Ur-6D for qemu-devel@nongnu.org; Wed, 05 Aug 2020 15:48:25 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55939 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k3POf-0008Pp-RY for qemu-devel@nongnu.org; Wed, 05 Aug 2020 15:48:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-H1FYUOb9Pb-Q6LC7kk2uYg-1; Wed, 05 Aug 2020 15:48:18 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B98280183C; Wed, 5 Aug 2020 19:48:17 +0000 (UTC) Received: from localhost (ovpn-112-108.rdu2.redhat.com [10.10.112.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0D4F10013D7; Wed, 5 Aug 2020 19:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596656899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ua8vzGT2EBSgdeNzQOoLqmsEH3spXT1WCJ+PlW9rv0g=; b=K9t5aehYUYHRjdiRNPyX4gXs60BVpmUyhvO4mZnJQRqH3RghPKV/LsSYzqVOBLWk2ImQ0a mRorIYZp9uhZABjL8rTpmfhbskp1q75PC946zZR3wLjjE1AhhD0w4RIlCIaQ2CZgnvBapc uPYG5L+mQ5aGhA5K1E1yc3xs7iFp62E= X-MC-Unique: H1FYUOb9Pb-Q6LC7kk2uYg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH] ide: Get rid of IDEDrive struct Date: Wed, 5 Aug 2020 15:48:12 -0400 Message-Id: <20200805194812.1735218-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ehabkost@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/05 00:45:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , Gerd Hoffmann , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The struct had a single field (IDEDevice dev), and is only used in the QOM type declarations and property lists. We can simply use the IDEDevice struct directly instead. Signed-off-by: Eduardo Habkost --- hw/ide/qdev.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 27ff1f7f66..dd3867d8b3 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -157,10 +157,6 @@ int ide_get_bios_chs_trans(BusState *bus, int unit) =20 /* --------------------------------- */ =20 -typedef struct IDEDrive { - IDEDevice dev; -} IDEDrive; - static void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp) { IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); @@ -297,19 +293,19 @@ static void ide_drive_realize(IDEDevice *dev, Error *= *errp) } =20 #define DEFINE_IDE_DEV_PROPERTIES() \ - DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \ - DEFINE_BLOCK_ERROR_PROPERTIES(IDEDrive, dev.conf), \ - DEFINE_PROP_STRING("ver", IDEDrive, dev.version), \ - DEFINE_PROP_UINT64("wwn", IDEDrive, dev.wwn, 0), \ - DEFINE_PROP_STRING("serial", IDEDrive, dev.serial),\ - DEFINE_PROP_STRING("model", IDEDrive, dev.model) + DEFINE_BLOCK_PROPERTIES(IDEDevice, conf), \ + DEFINE_BLOCK_ERROR_PROPERTIES(IDEDevice, conf), \ + DEFINE_PROP_STRING("ver", IDEDevice, version), \ + DEFINE_PROP_UINT64("wwn", IDEDevice, wwn, 0), \ + DEFINE_PROP_STRING("serial", IDEDevice, serial),\ + DEFINE_PROP_STRING("model", IDEDevice, model) =20 static Property ide_hd_properties[] =3D { DEFINE_IDE_DEV_PROPERTIES(), - DEFINE_BLOCK_CHS_PROPERTIES(IDEDrive, dev.conf), + DEFINE_BLOCK_CHS_PROPERTIES(IDEDevice, conf), DEFINE_PROP_BIOS_CHS_TRANS("bios-chs-trans", - IDEDrive, dev.chs_trans, BIOS_ATA_TRANSLATION_AUTO), - DEFINE_PROP_UINT16("rotation_rate", IDEDrive, dev.rotation_rate, 0), + IDEDevice, chs_trans, BIOS_ATA_TRANSLATION_AUTO), + DEFINE_PROP_UINT16("rotation_rate", IDEDevice, rotation_rate, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -327,7 +323,6 @@ static void ide_hd_class_init(ObjectClass *klass, void = *data) static const TypeInfo ide_hd_info =3D { .name =3D "ide-hd", .parent =3D TYPE_IDE_DEVICE, - .instance_size =3D sizeof(IDEDrive), .class_init =3D ide_hd_class_init, }; =20 @@ -350,7 +345,6 @@ static void ide_cd_class_init(ObjectClass *klass, void = *data) static const TypeInfo ide_cd_info =3D { .name =3D "ide-cd", .parent =3D TYPE_IDE_DEVICE, - .instance_size =3D sizeof(IDEDrive), .class_init =3D ide_cd_class_init, }; =20 @@ -373,7 +367,6 @@ static void ide_drive_class_init(ObjectClass *klass, vo= id *data) static const TypeInfo ide_drive_info =3D { .name =3D "ide-drive", .parent =3D TYPE_IDE_DEVICE, - .instance_size =3D sizeof(IDEDrive), .class_init =3D ide_drive_class_init, }; =20 --=20 2.26.2