Re: [PATCHv2 2/5] storage: prepare for refactoring

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

 



On 02/15/2013 02:22 PM, Peter Krempa wrote:

>> -    return 0;
>> +done:
>> +    ret = meta;
> 
> Um, is the ret variable really needed here? The only value it can take
> is "meta" and return it right after. If this isn't needed in the next
> patches I'd rather go for "return meta" here.
> 
>> +cleanup:
> 
> Rename this to "error"
> 
>> +    return ret;
> 
> And "return NULL" instead;

Next patch turns moves the allocation into this function, at which point
the tail end becomes:

done:
    ret = meta;
    meta = NULL;

cleanup:
    virStorageFileFreeMetadata(meta);
    VIR_FREE(buf);
    return ret;


> 
>>   }
>>
>>
> 
> ACK if:
> 1) this change will be needed later
> 2) tweaked according to my suggestions

I'm going with option 1 - the labels make more sense once patch 3 is in
place.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]