qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/23] block: Connect BlockBackend and DriveInfo


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 04/23] block: Connect BlockBackend and DriveInfo
Date: Thu, 11 Sep 2014 14:43:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

On 09/11/2014 12:03 PM, Markus Armbruster wrote:
> Benoît Canet <address@hidden> writes:
> 
>> The Wednesday 10 Sep 2014 à 10:13:33 (+0200), Markus Armbruster wrote :
>>> Make the BlockBackend own the DriveInfo.  Change blockdev_init() to
>>> return the BlockBackend instead of the DriveInfo.
>>>
>>> Signed-off-by: Markus Armbruster <address@hidden>
>>> ---


>>> +static void drive_info_del(DriveInfo *dinfo);
>>
>> Is there any technical reason not to just put the
>> drive_info_del above the blk_delete function ?
>> I don't see any possible circular references between the two.
>>
>> Some people like Eric frown upon static function prototypes
>> in final code that's why I am asking.

I dislike it in code I write, and so I point it out in reviews, but I
also concede that it is a style, not technical issue, so I will never
reject a patch that uses forward declarations if the author thinks that
makes the presentation of the overall file easier to follow.

> 
> Placing functions before their callers makes the program easier to read
> when you need to see the functions definition before you can understand
> their use.
> 
> Placing the functions after callers makes the program easier to read
> when the gist of what they do is obvious from the call.  You're omitting
> unnecessary detail there, to be flesh it own further down.  Saving a
> function declaration is immaterial compared to that.
> 
> Before I put the function where I don't want it, I'd inline it :)

Then I won't try to convince you to paint the bikeshed any other color.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]