[PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP
Nirmoy
nirmodas at amd.com
Wed Jan 22 09:32:47 UTC 2020
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.
> (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
More information about the amd-gfx
mailing list