All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 4/4] i8254: convert to qdev
Date: Sun, 06 Mar 2011 16:39:34 +0100	[thread overview]
Message-ID: <4D73AAB6.8000407@web.de> (raw)
In-Reply-To: <AANLkTinAPxH4qs-PFFzv70Q+v1Ky_a=JXHOFvKONeQyh@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

On 2011-03-06 16:35, Blue Swirl wrote:
> On Sun, Mar 6, 2011 at 5:10 PM, Jan Kiszka <jan.kiszka@web.de> wrote:
>> On 2011-02-13 22:10, Blue Swirl wrote:
>>> Convert to qdev. Don't expose PITState.
>>>
>>
>> ...
>>
>>> diff --git a/hw/pc.h b/hw/pc.h
>>> index 60f8c42..feb8a7a 100644
>>> --- a/hw/pc.h
>>> +++ b/hw/pc.h
>>> @@ -82,14 +82,23 @@ void isa_irq_handler(void *opaque, int n, int level);
>>>
>>>  #define PIT_FREQ 1193182
>>>
>>> -typedef struct PITState PITState;
>>> +static inline ISADevice *pit_init(int base, int irq)
>>> +{
>>> +    ISADevice *dev;
>>> +
>>> +    dev = isa_create("isa-pit");
>>> +    qdev_prop_set_uint32(&dev->qdev, "iobase", base);
>>> +    qdev_prop_set_uint32(&dev->qdev, "irq", irq);
>>> +    qdev_init_nofail(&dev->qdev);
>>> +
>>> +    return dev;
>>> +}
>>
>> This should be moved to i8254.c. We cannot compile the PIT out, and the
>> above contains no board information. So I see no reason for this inlining.
> 
> I see no reason for moving this back. In fact, if this was only used
> by PC, it could be moved to pc.c.

To my understanding, it's a factory helper for the PIT, avoiding
boilerplate code at the creator site. And if we get >1 users, this
cleanup would definitely pay off.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2011-03-06 15:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 21:10 [Qemu-devel] [PATCH 4/4] i8254: convert to qdev Blue Swirl
2011-03-06 15:10 ` [Qemu-devel] " Jan Kiszka
2011-03-06 15:35   ` Blue Swirl
2011-03-06 15:39     ` Jan Kiszka [this message]
2011-03-06 16:06       ` Blue Swirl
2011-03-06 16:08         ` Jan Kiszka
2011-03-06 16:31 ` [Qemu-devel] " Anthony Liguori
2011-03-06 16:47   ` Blue Swirl
2011-03-06 17:35     ` Blue Swirl
2011-03-06 17:47     ` Anthony Liguori
2011-03-06 18:06       ` [Qemu-devel] " Jan Kiszka
2011-03-06 20:45         ` Anthony Liguori
2011-03-06 21:15           ` Blue Swirl
2011-03-06 21:18           ` Jan Kiszka
2011-03-07  0:32             ` Anthony Liguori
2011-03-07  7:58               ` Jan Kiszka
2011-03-07 14:57                 ` Anthony Liguori
2011-03-07 15:46                   ` Jan Kiszka

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=4D73AAB6.8000407@web.de \
    --to=jan.kiszka@web.de \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.