[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-netdev
Subject:    Re: [PATCH 19/19] e1000: major part of the new API changes
From:       "Kok, Auke" <auke-jan.h.kok () intel ! com>
Date:       2007-03-30 20:56:32
Message-ID: 460D7980.5090600 () intel ! com
[Download RAW message or body]

Stephen Hemminger wrote:
>>  
>> +s32
>> +e1000_alloc_zeroed_dev_spec_struct(struct e1000_hw *hw, u32 size)
>> +{
>> +	hw->dev_spec = kmalloc(size, GFP_KERNEL);
>> +
>> +	if (!hw->dev_spec)
>> +		return -ENOMEM;
>> +
>> +	memset(hw->dev_spec, 0, size);
>> +
>> +	return E1000_SUCCESS;
>> +}
>>   
> 
> This is what is wrong with a lot of the new code. It is written as
> verbose as possible.
> 
> What is wrong with open coded
>     hw->dev_spec = kzalloc(size, GFP_KERNEL).

nothing, I'll make sure that we change this. Please remember that this code was 
written over a period of about 1 year, and a lot of cleanups that happened in 
other parts of e1000 may very well have been overlooked. Also, it may be "ugly" 
but it's definately not wrong at all.

>> +
>> +void
>> +e1000_free_dev_spec_struct(struct e1000_hw *hw)
>> +{
>> +	if (!hw->dev_spec)
>> +		return;
>> +
>> +	kfree(hw->dev_spec);
>> +}
>> +
>>   
> Almost looks like you contracted this out to someone paid by the LOC.

will fix, thanks for the comments.

Auke

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic