On 03/20/2014 01:44 PM, Eric Blake wrote:
> On 03/18/2014 06:24 AM, arei.gong...@huawei.com wrote:
>> From: ChenLiang <chenlian...@huawei.com>
>>
>> Rebuild the cache_is_cached function by cache_get_by_addr.
>>
>> Signed-off-by: ChenLiang <chenlian...@huawei.com>
>> Signed-off-by: Gonglei <arei.gong...@huawei.com>
>> ---
>>  page_cache.c | 38 ++++++++++++++++----------------------
>>  1 file changed, 16 insertions(+), 22 deletions(-)
>>
> 
>>  int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata,
>>                   uint64_t current_age)
>>  {
>>  
>> -    CacheItem *it = NULL;
>> -
>> -    g_assert(cache);
>> -    g_assert(cache->page_cache);
>> +    CacheItem *it;
> 
> Why are you dropping the asserts?

And if the answer is "because the caller is also asserting the same
thing", then mention it in the commit message.  The best commit messages
are the ones that not only mention WHAT (no silent changes), but also WHY.

-- 
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