From: Gerd Hoffmann <kraxel@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCHv4 1/2] qdev: add bit property type
Date: Mon, 04 Jan 2010 15:22:36 +0100 [thread overview]
Message-ID: <4B41F9AC.9010104@redhat.com> (raw)
In-Reply-To: <20091224124358.GB31553@redhat.com>
On 12/24/09 13:43, Michael S. Tsirkin wrote:
> This adds "bit" property type, which is a boolean stored in a 32 bit
> integer field, with legal values on and off. Will be used by virtio for
> feature bits.
> +static void *qdev_bit_prop_ptr(DeviceState *dev, Property *prop)
> +{
> + void *ptr = dev;
> + assert(prop->info->type == PROP_TYPE_BIT);
> + ptr += prop->offset / 32;
> + return ptr;
> +}
I don't like that idea. IMHO prop->offset should be specified in bytes
no matter what the property is. Better add a new prop->bitnr field to
specify which bit of the 32bit word should be toggled. Then you don't
need this function in the first place.
cheers,
Gerd
next parent reply other threads:[~2010-01-04 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1261657570.git.mst@redhat.com>
[not found] ` <20091224124358.GB31553@redhat.com>
2010-01-04 14:22 ` Gerd Hoffmann [this message]
2010-01-04 15:38 ` [Qemu-devel] Re: [PATCHv4 1/2] qdev: add bit property type Michael S. Tsirkin
[not found] ` <20091224124427.GC31553@redhat.com>
2010-01-04 14:24 ` [Qemu-devel] Re: [PATCHv4 2/2] virtio: add features as qdev properties Gerd Hoffmann
2010-01-04 15:38 ` Michael S. Tsirkin
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=4B41F9AC.9010104@redhat.com \
--to=kraxel@redhat.com \
--cc=mst@redhat.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.