amdgpu: use NULL instead of 0 for pointer
Subsystems (2)
PATCH 1/1 amdgpu: use NULL instead of 0 for pointer
In the AMD powerplay driver, a pointer is checked for validity by comparing against an integer '0', which causes a harmless warning when building with "make W=1":
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra]
This changes the code to the more conventional "if (pointer)" check.
--- drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +1 -1
@@ -1499,7 +1499,7 @@ int get_number_of_vce_state_table_entries(const ATOM_PPLIB_VCE_State_Table *vce_table =get_vce_state_table (hwmgr, table); -if (vce_table >0 ) +if (vce_table)return vce_table->numEntries;return 0 ;
Signature · 1 line
2.9.0
Am 15.06.2016 um 22:15 schrieb Arnd Bergmann:
Quoted 9 lines
In the AMD powerplay driver, a pointer is checked for validity by comparing against an integer '0', which causes a harmless warning when building with "make W=1":
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra]This changes the code to the more conventional "if (pointer)" check.
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +0
-0
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c int get_number_of_vce_state_table_entries( · line 1505
Quoted 8 lines
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +1
-1@@ -1499,7 +1499,7 @@ int get_number_of_vce_state_table_entries(const ATOM_PPLIB_VCE_State_Table *vce_table =get_vce_state_table (hwmgr, table); -if (vce_table >0 ) +if (vce_table)return vce_table->numEntries;return 0 ;
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 9 lines · Christian König
Am 15.06.2016 um 22:15 schrieb Arnd Bergmann:
Quoted 8 lines
In the AMD powerplay driver, a pointer is checked for validity by comparing against an integer '0', which causes a harmless warning when building with "make W=1":
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16:
error: ordered comparison of pointer with integer zero [-Werror=extra]
Quoted 6 lines
Quoted 3 lines
This changes the code to the more conventional "if (pointer)" check.
Signed-off-by Arnd Bergmann <[email protected]>Reviewed-by Christian König <[email protected]>.
Applied. thanks!
Alex
Quoted 15 lines
Quoted 15 lines
--- drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +1
-0@@ -1499,7 +1499,7 @@ int get_number_of_vce_state_table_entries(const ATOM_PPLIB_VCE_State_Table *vce_table =get_vce_state_table (hwmgr, table); - if (vce_table > 0) + if (vce_table)
Quoted 8 lines
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c int get_number_of_vce_state_table_entries( · line 1505
Quoted 2 lines
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +0
-0return vce_table->numEntries;return 0 ;_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel