From nobody Mon Feb 9 03:29:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.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 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1546626103524764.4863130088313; Fri, 4 Jan 2019 10:21:43 -0800 (PST) Received: from localhost ([127.0.0.1]:37983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfU6I-000318-BZ for importer@patchew.org; Fri, 04 Jan 2019 13:21:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfToE-0006pB-EA for qemu-devel@nongnu.org; Fri, 04 Jan 2019 13:03:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfToD-0006MO-Jw for qemu-devel@nongnu.org; Fri, 04 Jan 2019 13:03:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29461) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfToB-0006JN-5z; Fri, 04 Jan 2019 13:02:59 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3794DBF9F2; Fri, 4 Jan 2019 18:02:58 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-119.brq.redhat.com [10.40.204.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C53965471D; Fri, 4 Jan 2019 18:02:35 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Date: Fri, 4 Jan 2019 18:58:47 +0100 Message-Id: <20190104175847.6290-17-philmd@redhat.com> In-Reply-To: <20190104175847.6290-1-philmd@redhat.com> References: <20190104175847.6290-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 04 Jan 2019 18:02:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 16/16] RFC hw/net/smc91c111: Convert init helper into an inline function 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: Peter Maydell , Jason Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Rob Herring , Magnus Damm , Joel Stanley , David Gibson , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Richard Henderson , Andrew Jeffery , Bastian Koppelmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mitsyanko , Michael Walle , qemu-ppc@nongnu.org, Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- As init helper in "hw/char/pl011.h" --- hw/net/smc91c111.c | 17 ----------------- include/hw/net/smc91c111.h | 25 ++++++++++++++++++++++++- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index d19ea0750d..3472852270 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -18,7 +18,6 @@ /* Number of 2k memory pages available. */ #define NUM_PACKETS 4 =20 -#define TYPE_SMC91C111 "smc91c111" #define SMC91C111(obj) OBJECT_CHECK(smc91c111_state, (obj), TYPE_SMC91C111) =20 typedef struct { @@ -809,20 +808,4 @@ static void smc91c111_register_types(void) type_register_static(&smc91c111_info); } =20 -/* Legacy helper function. Should go away when machine config files are - implemented. */ -void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq) -{ - DeviceState *dev; - SysBusDevice *s; - - qemu_check_nic_model(nd, "smc91c111"); - dev =3D qdev_create(NULL, TYPE_SMC91C111); - qdev_set_nic_properties(dev, nd); - qdev_init_nofail(dev); - s =3D SYS_BUS_DEVICE(dev); - sysbus_mmio_map(s, 0, base); - sysbus_connect_irq(s, 0, irq); -} - type_init(smc91c111_register_types) diff --git a/include/hw/net/smc91c111.h b/include/hw/net/smc91c111.h index 46f7d9a5d4..0a1097ddd2 100644 --- a/include/hw/net/smc91c111.h +++ b/include/hw/net/smc91c111.h @@ -10,9 +10,32 @@ #ifndef HW_NET_SMC91C111_H #define HW_NET_SMC91C111_H =20 +#include "hw/qdev.h" #include "hw/irq.h" +#include "hw/sysbus.h" #include "net/net.h" =20 -void smc91c111_init(NICInfo *, uint32_t, qemu_irq); +#define TYPE_SMC91C111 "smc91c111" + +/* + * Legacy helper function. Should go away when machine config files are + * implemented. + */ +static inline DeviceState *smc91c111_init(NICInfo *nd, + uint32_t base, qemu_irq irq) +{ + DeviceState *dev; + SysBusDevice *s; + + qemu_check_nic_model(nd, "smc91c111"); + dev =3D qdev_create(NULL, TYPE_SMC91C111); + qdev_set_nic_properties(dev, nd); + qdev_init_nofail(dev); + s =3D SYS_BUS_DEVICE(dev); + sysbus_mmio_map(s, 0, base); + sysbus_connect_irq(s, 0, irq); + + return dev; +} =20 #endif --=20 2.17.2