From patchwork Thu Jun 6 11:06:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1111055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45KNYf1qchz9s3l for ; Thu, 6 Jun 2019 21:22:46 +1000 (AEST) Received: from localhost ([127.0.0.1]:58623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYqTj-0004dY-Uo for incoming@patchwork.ozlabs.org; Thu, 06 Jun 2019 07:22:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYqFf-0000fj-JG for qemu-devel@nongnu.org; Thu, 06 Jun 2019 07:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYqFe-00044t-Ks for qemu-devel@nongnu.org; Thu, 06 Jun 2019 07:08:11 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:41985) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYqFX-0003s4-Al; Thu, 06 Jun 2019 07:08:03 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mjjvp-1gpIoP3RQB-00lIOV; Thu, 06 Jun 2019 13:06:55 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 6 Jun 2019 13:06:19 +0200 Message-Id: <20190606110625.32127-11-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190606110625.32127-1-laurent@vivier.eu> References: <20190606110625.32127-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:aAa1raASz8JOmSHlj+lCdaiafK8ieKWUPyy/UkUZ38PqO9+KY5j rycJ0oIdjZws5HBSsWNdb41aH1emLIY8VwJIOPyX0fx8uGumkPozjf5X2RcmUEJoIQIjzRP G/E4kNIwblA3p5Aki9SPJDiU/YiMBcHPigbIK8kcbAft51Zc2UqzB+SeoS8FV2pM1UFTR40 8O73Da6kZRsn9RxZAYLKQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:TaGw/BMz8Ds=:+RxgS5R5CEPEwcHSeBiEa9 6BPo33XP9pjQQDFUbXt5rUEFQ9qDhLHbSEj1s9e8h+ELqtsOuMgawgprMxGMFasq5bHCDhsrA rEGFmcOc4AcilUwmi9Il4f6Fhi0GkbwUkJxhTrO0AHiCkTC2k1LQv6YR3XsxFUBEUvernwNDM 7Kp5EGnUfUL1jJdLkur8cs1450ZBX6IMw3tlhgN7MB8waCcczeca8QrK2wHmnNvVINAW4C9VF 076o/oaWLs8OmHM2Ba3re/hyW1FNPnrQCmPkptAEkUc85M9rWNsZ30lBe4rbckpy3iqh6rNpS RQfbvd6ipvUbm3+68smisfzvAr2dbmsUanIvCHL+jnbfLNeKYdlT4OXVMucj3bOMGapK8qfLt 8SAbmK8h54US12l96MBh1ODXxnbS6KpIXdAb9IkO1P3rXJeV6tCKuZofYh/Qpe6Ak47bjt8Jf BG9qOPwhIyZKqbiZHYOh1axIK32ket6NzhSth8K15UDjjwTQhw+CKeIqEAv714AfbcdJAaQl6 9w54CcvGxgtkxjNhAUGDC6bmaiScLH+4MgKqIN13gIVfMUGdec86e8NhAyU/JDDd8IweA+MTW fj7nktBu9b91KA9Fo5MSZhL9lmtgcE+SBx4P73trB72Y308XOw3GczzjSDkWstiLcOI2v7u2y 9FWCw2gbZ1nUOcM9cdK4jh4ps/mRe18ZFymKmWvTVC9gO5Fs8lm9O9NY3hQfXNPZelfFU/1U6 Gedg7yXzCJiLGP2gjEfwPNBJnrI2qLuxUgxd0855y252S8K3lP5hzZCM2t4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 10/16] hw/isa: Use the QOM DEVICE() macro to access DeviceState.qdev 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: Fam Zheng , Peter Maydell , Dmitry Fleytman , David Hildenbrand , Michael Tokarev , Gerd Hoffmann , Juan Quintela , Aleksandar Rikalo , "Michael S. Tsirkin" , Halil Pasic , Christian Borntraeger , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Yuval Shaia , Alex Williamson , Richard Henderson , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-s390x@nongnu.org, Cornelia Huck , Laurent Vivier , qemu-trivial@nongnu.org, Michael Walle , Aleksandar Markovic , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Rather than looking inside the definition of a DeviceState with "s->qdev", use the QOM prefered style: "DEVICE(s)". This patch was generated using the following Coccinelle script: // Use DEVICE() macros to access DeviceState.qdev @use_device_macro_to_access_qdev@ expression obj; identifier dev; @@ -&obj->dev.qdev +DEVICE(obj) Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marcel Apfelbaum Message-Id: <20190528164020.32250-8-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/isa/lpc_ich9.c | 2 +- hw/isa/vt82c686.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 031ee9cd933d..35d17246e940 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -412,7 +412,7 @@ void ich9_lpc_pm_init(PCIDevice *lpc_pci, bool smm_enabled) true); } - ich9_lpc_reset(&lpc->d.qdev); + ich9_lpc_reset(DEVICE(lpc)); } /* APM */ diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 85d0532dd5b5..d46754f61cfb 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -369,7 +369,7 @@ static void vt82c686b_pm_realize(PCIDevice *dev, Error **errp) pci_conf[0x90] = s->smb_io_base | 1; pci_conf[0x91] = s->smb_io_base >> 8; pci_conf[0xd2] = 0x90; - pm_smbus_init(&s->dev.qdev, &s->smb, false); + pm_smbus_init(DEVICE(s), &s->smb, false); memory_region_add_subregion(get_system_io(), s->smb_io_base, &s->smb.io); apm_init(dev, &s->apm, NULL, s);