Re: [PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP

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

 



On 2020-01-22 4:32 a.m., Nirmoy wrote:
> 
> On 1/22/20 12:34 AM, Luben Tuikov wrote:
>>
>>> +		for (j = 0; j < amdgpu_ctx_num_entities[i]; ++j) {
>>> +			struct amdgpu_ctx_entity *entity = &ctx->entities[i][j];
>>>   
>>> -		kfree(entity->fences);
>>> -		entity->fences = NULL;
>>> +			kfree(entity->fences);
>>> +			entity->fences = NULL;
>>> +		}
>>> +
>>> +error_cleanup_entity_memory:
>> "cleanup" refers to something spilled, or something to be collected.
> It is  collecting memory.

But it really is doing a "kfree()". Freeing previously allocated
memory. The traditional working is most accessible, in my opinion.

>> (Or winning in a wagered game of chance.) Also at "module_exit", maybe.
>>
>> The kernel has traditionally used "unroll" and "free" for this. Now, since
>> you're unrolling the loop (notice that it sits after the "return 0;"), then
>> you can backtrack and name it like this:
>>
>> Error_unroll_free1:
>> 	for ( ; i >= 0; i--)
>> 		free(my_array[i]);
>>
> I prefer the existing style makes it more readable.
> 
> 
> Regards,
> 
> Nirmoy
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux