[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()
From: |
Avi Kivity |
Subject: |
Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find() |
Date: |
Mon, 19 Dec 2011 17:28:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 |
On 12/19/2011 05:25 PM, Anthony Liguori wrote:
>> I rather like the pattern
>>
>> void callback(void *_foo)
>> {
>> Foo *foo = _foo;
>>
>> ...
>> }
>>
>> If the consensus is that we don't want it, I'll change it, but I do
>> think it's useful.
>
>
> I dislike enforcing coding style but it's a necessary evil. I greater
> prefer simple rules to subtle ones as it creates less confusion so I'd
> prefer you change this.
Okay.
>> How can I return a pointer? If I allocate it, someone has to free it.
>> If I pass it as a parameter, we end up with a silly looking calling
>> convention. If I return an error code, the caller has to set up an
>> additional variable.
>>
>> The natural check is section.size which is always meaningful -
>> memory_region_find() returns a subrange of the input, which may be
>> zero. You're right that I should document it (and I should use it
>> consistently).
>
> I'm not going to make a fuss over something like this so if you really
> prefer this style, I'm not going to object strongly.
>
> But it should be at least be documented and used consistently.
Will update both.
--
error compiling committee.c: too many arguments to function
- [Qemu-devel] [PATCH 15/23] xen, vga: add API for registering the framebuffer, (continued)
- [Qemu-devel] [PATCH 15/23] xen, vga: add API for registering the framebuffer, Avi Kivity, 2011/12/19
- [Qemu-devel] [PATCH 12/23] fixup: listener fixes, Avi Kivity, 2011/12/19
- [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Avi Kivity, 2011/12/19
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Avi Kivity, 2011/12/19
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Avi Kivity, 2011/12/19
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(),
Avi Kivity <=
- Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find(), Avi Kivity, 2011/12/19
[Qemu-devel] [PATCH 17/23] xen: convert to MemoryListener API, Avi Kivity, 2011/12/19
[Qemu-devel] [PATCH 14/23] vhost: convert to MemoryListener API, Avi Kivity, 2011/12/19
[Qemu-devel] [PATCH 21/23] virtio-balloon: avoid cpu_get_physical_page_desc(), Avi Kivity, 2011/12/19
[Qemu-devel] [PATCH 07/23] framebuffer: drop use of cpu_physical_sync_dirty_bitmap(), Avi Kivity, 2011/12/19
[Qemu-devel] [PATCH 02/23] sysbus: add sysbus_address_space(), Avi Kivity, 2011/12/19