From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 03/10] ne2000_isa: refactor device creation
Date: Sun, 13 Feb 2011 00:41:03 +0200 [thread overview]
Message-ID: <AANLkTimAJd79KRzbESmmJ4ga1CVTAKLu_qZjxXBiq2oR@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]
Turn isa_ne2000_init into an inline function.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/ne2000-isa.c | 13 -------------
hw/pc.h | 12 +++++++++++-
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/hw/ne2000-isa.c b/hw/ne2000-isa.c
index 3ff0d89..e41dbba 100644
--- a/hw/ne2000-isa.c
+++ b/hw/ne2000-isa.c
@@ -92,19 +92,6 @@ static int isa_ne2000_initfn(ISADevice *dev)
return 0;
}
-void isa_ne2000_init(int base, int irq, NICInfo *nd)
-{
- ISADevice *dev;
-
- qemu_check_nic_model(nd, "ne2k_isa");
-
- dev = isa_create("ne2k_isa");
- qdev_prop_set_uint32(&dev->qdev, "iobase", base);
- qdev_prop_set_uint32(&dev->qdev, "irq", irq);
- qdev_set_nic_properties(&dev->qdev, nd);
- qdev_init_nofail(&dev->qdev);
-}
-
static ISADeviceInfo ne2000_isa_info = {
.qdev.name = "ne2k_isa",
.qdev.size = sizeof(ISANE2000State),
diff --git a/hw/pc.h b/hw/pc.h
index f823b7d..abdf307 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -176,8 +176,18 @@ void pci_cirrus_vga_init(PCIBus *bus);
void isa_cirrus_vga_init(void);
/* ne2000.c */
+static inline void isa_ne2000_init(int base, int irq, NICInfo *nd)
+{
+ ISADevice *dev;
-void isa_ne2000_init(int base, int irq, NICInfo *nd);
+ qemu_check_nic_model(nd, "ne2k_isa");
+
+ dev = isa_create("ne2k_isa");
+ qdev_prop_set_uint32(&dev->qdev, "iobase", base);
+ qdev_prop_set_uint32(&dev->qdev, "irq", irq);
+ qdev_set_nic_properties(&dev->qdev, nd);
+ qdev_init_nofail(&dev->qdev);
+}
/* e820 types */
#define E820_RAM 1
--
1.6.2.4
[-- Attachment #2: 0003-ne2000_isa-refactor-device-creation.patch --]
[-- Type: application/mbox, Size: 2069 bytes --]
reply other threads:[~2011-02-12 22:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimAJd79KRzbESmmJ4ga1CVTAKLu_qZjxXBiq2oR@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).