[PATCH 2/2] drm/admgpu: clean the dummy sw_init functions

Khatri, Sunil sunil.khatri at amd.com
Wed Oct 9 12:00:19 UTC 2024


On 10/9/2024 4:21 PM, Christian König wrote:
> Am 09.10.24 um 10:48 schrieb Sunil Khatri:
>> Remove the dummy sw_init functions and set the
>> corresponding functions to NULL.
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 5 -----
>>   drivers/gpu/drm/amd/amdgpu/cik.c        | 7 +------
>>   drivers/gpu/drm/amd/amdgpu/si.c         | 7 +------
>>   3 files changed, 2 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> index adc0b80ca5db..4add6c412779 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> @@ -33,11 +33,6 @@
>>   #include "isp_v4_1_0.h"
>>   #include "isp_v4_1_1.h"
>>   -static int isp_sw_init(struct amdgpu_ip_block *ip_block)
>> -{
>> -    return 0;
>> -}
>> -
>>   static int isp_sw_fini(struct amdgpu_ip_block *ip_block)
>>   {
>>       return 0;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c 
>> b/drivers/gpu/drm/amd/amdgpu/cik.c
>> index 6c18ab35cf69..bb961b274487 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
>> @@ -2124,11 +2124,6 @@ static int cik_common_early_init(struct 
>> amdgpu_ip_block *ip_block)
>>       return 0;
>>   }
>>   -static int cik_common_sw_init(struct amdgpu_ip_block *ip_block)
>> -{
>> -    return 0;
>> -}
>> -
>>   static int cik_common_sw_fini(struct amdgpu_ip_block *ip_block)
>>   {
>>       return 0;
>> @@ -2195,7 +2190,7 @@ static const struct amd_ip_funcs 
>> cik_common_ip_funcs = {
>>       .name = "cik_common",
>>       .early_init = cik_common_early_init,
>>       .late_init = NULL,
>> -    .sw_init = cik_common_sw_init,
>> +    .sw_init = NULL,
>>       .sw_fini = cik_common_sw_fini,
>>       .hw_init = cik_common_hw_init,
>>       .hw_fini = cik_common_hw_fini,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/si.c 
>> b/drivers/gpu/drm/amd/amdgpu/si.c
>> index b9934661a92e..0578c7ce4dc5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/si.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/si.c
>> @@ -2148,11 +2148,6 @@ static int si_common_early_init(struct 
>> amdgpu_ip_block *ip_block)
>>       return 0;
>>   }
>>   -static int si_common_sw_init(struct amdgpu_ip_block *ip_block)
>> -{
>> -    return 0;
>> -}
>> -
>>   static int si_common_sw_fini(struct amdgpu_ip_block *ip_block)
>>   {
>>       return 0;
>> @@ -2691,7 +2686,7 @@ static const struct amd_ip_funcs 
>> si_common_ip_funcs = {
>>       .name = "si_common",
>>       .early_init = si_common_early_init,
>>       .late_init = NULL,
>> -    .sw_init = si_common_sw_init,
>> +    .sw_init = NULL,
>
> BTW don't do that, just don't initialize the field at all.
>
> Uninitialized fields in global variables are NULL or 0 in C by 
> standard definition and Greg usually complains if we do stuff like that.
Sure will remove the initialization completely for it in v3 patch set.
>
> Regards,
> Christian.
>
>>       .sw_fini = si_common_sw_fini,
>>       .hw_init = si_common_hw_init,
>>       .hw_fini = si_common_hw_fini,
>


More information about the amd-gfx mailing list