[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 09/15] eepro100: convert to new pci interfac
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] Re: [PATCH 09/15] eepro100: convert to new pci interface |
Date: |
Wed, 10 Feb 2010 11:43:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
"Michael S. Tsirkin" <address@hidden> writes:
> On Wed, Feb 10, 2010 at 07:32:10AM +0100, Stefan Weil wrote:
>> See my inline comments.
>>
>>
>> Anthony Liguori schrieb:
[...]
>> > -static void pci_map(PCIDevice * pci_dev, int region_num,
>> > - pcibus_t addr, pcibus_t size, int type)
>> > +static void pci_io_write(PCIDevice *dev, pcibus_t addr, int size,
>> > + uint32_t value)
>> > {
>> > - EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev);
>> > -
>> > - TRACE(OTHER, logout("region %d, addr=0x%08"FMT_PCIBUS", "
>> > - "size=0x%08"FMT_PCIBUS", type=%d\n",
>> > - region_num, addr, size, type));
>> > + EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, dev);
>> >
>>
>> Please don't change the name of the PCIDevice pointer argument
>> from pci_dev to dev.
>>
>> This dev, dev in DO_UPCAST is ugly and misleading.
>
> It's a matter of taste: I actually think it's pretty: I never remember
> which argument of DO_UPCAST is which, and if both are dev it doesn't
> matter.
I also have trouble remembering how to use DO_UPCAST(), but playing
games with identifiers is a poor fix for that. I find the use of the
same name "dev" for two different things in the same expression rather
confusing. Could we improve DO_UPCAST() instead?
For what it's worth, I have no trouble with container_of(). DO_UPCAST()
takes the same arguments in a different order, which I find irritating.
[...]
- Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API, (continued)
- Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API, Anthony Liguori, 2010/02/09
- Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API, malc, 2010/02/09
- Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API, Anthony Liguori, 2010/02/09
- Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API, malc, 2010/02/09
- Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API, Anthony Liguori, 2010/02/11
[Qemu-devel] [PATCH 06/15] wdt_i6300esb: convert to new pci inteface, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 04/15] e1000: convert to new pci interface, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 09/15] eepro100: convert to new pci interface, Anthony Liguori, 2010/02/09
Re: [Qemu-devel] [PATCH 09/15] eepro100: convert to new pci interface, Anthony Liguori, 2010/02/10
[Qemu-devel] [PATCH 03/15] lsi53c895a: convert to new pci interfaces, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 15/15] pci: byte swap as PCI interface layer, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 10/15] virtio-pci: convert to new pci interface, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 11/15] pci: add pci_register_msix_region, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 14/15] usb-uhci: convert to new pci interface, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 08/15] es1370: convert to new pci interface, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 13/15] pcnet: convert to new pci interface, Anthony Liguori, 2010/02/09
[Qemu-devel] [PATCH 12/15] ne2000: convert to new pci interface, Anthony Liguori, 2010/02/09