From nobody Wed Nov 27 19:44:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697622478885130.63917507087547; Wed, 18 Oct 2023 02:47:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt38J-00016e-7I; Wed, 18 Oct 2023 05:46:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt38D-0000yz-OA for qemu-devel@nongnu.org; Wed, 18 Oct 2023 05:46:26 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt38C-0003Wp-1r for qemu-devel@nongnu.org; Wed, 18 Oct 2023 05:46:25 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4S9QwH2dTRz4xc1; Wed, 18 Oct 2023 20:46:23 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4S9QwF1xB7z4xbC; Wed, 18 Oct 2023 20:46:21 +1100 (AEDT) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Zhenzhong Duan , Tony Krowiak , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 17/22] vfio/ap: Remove pointless apdev variable Date: Wed, 18 Oct 2023 11:45:26 +0200 Message-ID: <20231018094531.733211-18-clg@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018094531.733211-1-clg@redhat.com> References: <20231018094531.733211-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=150.107.74.76; envelope-from=SRS0=VFJy=GA=redhat.com=clg@ozlabs.org; helo=gandalf.ozlabs.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1697622480386100003 From: Zhenzhong Duan No need to double-cast, call VFIO_AP_DEVICE() on DeviceState. No functional changes. Signed-off-by: Zhenzhong Duan Reviewed-by: Tony Krowiak Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio/ap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index f870f51ffab4a637d2472db4fe4141ec7c54a470..5f257bffb9d2bfead9271bf2f4e= 3e3f610b78696 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -156,8 +156,7 @@ static void vfio_ap_realize(DeviceState *dev, Error **e= rrp) { int ret; Error *err =3D NULL; - APDevice *apdev =3D AP_DEVICE(dev); - VFIOAPDevice *vapdev =3D VFIO_AP_DEVICE(apdev); + VFIOAPDevice *vapdev =3D VFIO_AP_DEVICE(dev); VFIODevice *vbasedev =3D &vapdev->vdev; =20 vbasedev->name =3D g_path_get_basename(vbasedev->sysfsdev); @@ -197,8 +196,7 @@ error: =20 static void vfio_ap_unrealize(DeviceState *dev) { - APDevice *apdev =3D AP_DEVICE(dev); - VFIOAPDevice *vapdev =3D VFIO_AP_DEVICE(apdev); + VFIOAPDevice *vapdev =3D VFIO_AP_DEVICE(dev); =20 vfio_ap_unregister_irq_notifier(vapdev, VFIO_AP_REQ_IRQ_INDEX); vfio_detach_device(&vapdev->vdev); @@ -213,8 +211,7 @@ static Property vfio_ap_properties[] =3D { static void vfio_ap_reset(DeviceState *dev) { int ret; - APDevice *apdev =3D AP_DEVICE(dev); - VFIOAPDevice *vapdev =3D VFIO_AP_DEVICE(apdev); + VFIOAPDevice *vapdev =3D VFIO_AP_DEVICE(dev); =20 ret =3D ioctl(vapdev->vdev.fd, VFIO_DEVICE_RESET); if (ret) { --=20 2.41.0