From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Marc Marí" <marc.mari.barcelo@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] libqos: Remove PCI assumptions in virtio driver
Date: Thu, 2 Oct 2014 13:02:25 +0100 [thread overview]
Message-ID: <20141002120225.GA29693@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1409847879-9783-2-git-send-email-marc.mari.barcelo@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2362 bytes --]
On Thu, Sep 04, 2014 at 06:24:37PM +0200, Marc Marí wrote:
> @@ -60,25 +60,25 @@ static void qvirtio_pci_assign_device(QVirtioDevice *d, void *data)
> *vpcidev = (QVirtioPCIDevice *)d;
> }
>
> -static uint8_t qvirtio_pci_config_readb(QVirtioDevice *d, void *addr)
> +static uint8_t qvirtio_pci_config_readb(QVirtioDevice *d, uint64_t addr)
> {
> QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
> - return qpci_io_readb(dev->pdev, addr);
> + return qpci_io_readb(dev->pdev, (void *)addr);
You do not need casts in C for void* to any pointer type or any pointer
type to void*. Please drop them.
> diff --git a/tests/libqos/virtio-pci.h b/tests/libqos/virtio-pci.h
> index 883f7ff..8f0e52a 100644
> --- a/tests/libqos/virtio-pci.h
> +++ b/tests/libqos/virtio-pci.h
> @@ -13,18 +13,18 @@
> #include "libqos/virtio.h"
> #include "libqos/pci.h"
>
> -#define QVIRTIO_DEVICE_FEATURES 0x00
> -#define QVIRTIO_GUEST_FEATURES 0x04
> -#define QVIRTIO_QUEUE_ADDRESS 0x08
> -#define QVIRTIO_QUEUE_SIZE 0x0C
> -#define QVIRTIO_QUEUE_SELECT 0x0E
> -#define QVIRTIO_QUEUE_NOTIFY 0x10
> -#define QVIRTIO_DEVICE_STATUS 0x12
> -#define QVIRTIO_ISR_STATUS 0x13
> -#define QVIRTIO_MSIX_CONF_VECTOR 0x14
> -#define QVIRTIO_MSIX_QUEUE_VECTOR 0x16
> -#define QVIRTIO_DEVICE_SPECIFIC_MSIX 0x18
> -#define QVIRTIO_DEVICE_SPECIFIC_NO_MSIX 0x14
> +#define QVIRTIO_PCI_DEVICE_FEATURES 0x00
> +#define QVIRTIO_PCI_GUEST_FEATURES 0x04
> +#define QVIRTIO_PCI_QUEUE_ADDRESS 0x08
> +#define QVIRTIO_PCI_QUEUE_SIZE 0x0C
> +#define QVIRTIO_PCI_QUEUE_SELECT 0x0E
> +#define QVIRTIO_PCI_QUEUE_NOTIFY 0x10
> +#define QVIRTIO_PCI_DEVICE_STATUS 0x12
> +#define QVIRTIO_PCI_ISR_STATUS 0x13
> +#define QVIRTIO_PCI_MSIX_CONF_VECTOR 0x14
> +#define QVIRTIO_PCI_MSIX_QUEUE_VECTOR 0x16
> +#define QVIRTIO_PCI_DEVICE_SPECIFIC_MSIX 0x18
> +#define QVIRTIO_PCI_DEVICE_SPECIFIC_NO_MSIX 0x14
This is a nice isolated change that could be made in a separate commit
from the void* -> uint64_t change.
It's a matter of style but makes code review easier since it is harder
to review a patch that is performing multiple changes at once.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-10-02 12:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 16:24 [Qemu-devel] [PATCH 0/3] Virtio MMIO libqos driver Marc Marí
2014-09-04 16:24 ` [Qemu-devel] [PATCH 1/3] libqos: Remove PCI assumptions in virtio driver Marc Marí
2014-10-02 12:02 ` Stefan Hajnoczi [this message]
2014-10-03 11:53 ` Marc Marí
2014-10-06 9:02 ` Stefan Hajnoczi
2014-09-04 16:24 ` [Qemu-devel] [PATCH 2/3] libqos: Add malloc generic Marc Marí
2014-10-02 12:09 ` Stefan Hajnoczi
2014-09-04 16:24 ` [Qemu-devel] [PATCH 3/3] libqos: Add virtio MMIO support Marc Marí
2014-10-02 12:24 ` Stefan Hajnoczi
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=20141002120225.GA29693@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=marc.mari.barcelo@gmail.com \
--cc=pbonzini@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 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).