drm/amd/pm: Remove many unnecessary NULL values
authorRuan Jinjie <ruanjinjie@huawei.com>
Tue, 1 Aug 2023 12:55:14 +0000 (20:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Aug 2023 13:42:20 +0000 (09:42 -0400)
Ther are many pointers assigned first, which need not to be initialized, so
remove the NULL assignment.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c

index 182118e3fd5f3a1ab3e50436ddf8862277fe7a7a..5794b64507bf948cc5b91ee5228759cce6a4764c 100644 (file)
@@ -1237,7 +1237,7 @@ static int get_vce_clock_voltage_limit_table(struct pp_hwmgr *hwmgr,
                const VCEClockInfoArray    *array)
 {
        unsigned long i;
-       struct phm_vce_clock_voltage_dependency_table *vce_table = NULL;
+       struct phm_vce_clock_voltage_dependency_table *vce_table;
 
        vce_table = kzalloc(struct_size(vce_table, entries, table->numEntries),
                            GFP_KERNEL);
index 4bc8db1be738a6e11574c698cf856124f971cf61..9e4228232f024e53cf61dcc4027bbe0d93a7153c 100644 (file)
@@ -2732,7 +2732,7 @@ static bool ci_is_dpm_running(struct pp_hwmgr *hwmgr)
 
 static int ci_smu_init(struct pp_hwmgr *hwmgr)
 {
-       struct ci_smumgr *ci_priv = NULL;
+       struct ci_smumgr *ci_priv;
 
        ci_priv = kzalloc(sizeof(struct ci_smumgr), GFP_KERNEL);
 
index 02c094a06605d3ab41f3906a1ca9633089b3e98d..5e43ad2b295641d43265523047d41b19363407f3 100644 (file)
@@ -332,7 +332,7 @@ static bool fiji_is_hw_avfs_present(struct pp_hwmgr *hwmgr)
 
 static int fiji_smu_init(struct pp_hwmgr *hwmgr)
 {
-       struct fiji_smumgr *fiji_priv = NULL;
+       struct fiji_smumgr *fiji_priv;
 
        fiji_priv = kzalloc(sizeof(struct fiji_smumgr), GFP_KERNEL);
 
index 060fc140c5744c94d420906c12736d1eaf7ffbca..97d9802fe6731fcc4c9e1b35e10329e28fa7194e 100644 (file)
@@ -259,7 +259,7 @@ static int iceland_start_smu(struct pp_hwmgr *hwmgr)
 
 static int iceland_smu_init(struct pp_hwmgr *hwmgr)
 {
-       struct iceland_smumgr *iceland_priv = NULL;
+       struct iceland_smumgr *iceland_priv;
 
        iceland_priv = kzalloc(sizeof(struct iceland_smumgr), GFP_KERNEL);
 
index acbe41174d7e61522af8ee8356897aa221ae3aae..6fe6e6abb5d8159852c6cc21181850425260dd26 100644 (file)
@@ -226,7 +226,7 @@ static int tonga_start_smu(struct pp_hwmgr *hwmgr)
 
 static int tonga_smu_init(struct pp_hwmgr *hwmgr)
 {
-       struct tonga_smumgr *tonga_priv = NULL;
+       struct tonga_smumgr *tonga_priv;
 
        tonga_priv = kzalloc(sizeof(struct tonga_smumgr), GFP_KERNEL);
        if (tonga_priv == NULL)