fix warning for condition check
Subsystems (2)
cover fix warning for condition check
*** BLURB HERE ***
Sunil Khatri (5):
drm/amdgpu: fix ptr check warning in gfx9 ip_dump drm/amdgpu: fix ptr check warning in gfx10 ip_dump drm/amdgpu: fix ptr check warning in gfx11 ip_dump drm/amdgpu: fix ptr check warning in gfx12 ip_dump drm/amdgpu: fix ptr check warning in vcn_v3 ip_dump
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/5 drm/amdgpu: fix ptr check warning in gfx9 ip_dump
Change if (ptr == NULL) to if (!ptr) for a better
format and fix the warning.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -2129,7 +2129,7 @@ static void gfx_v9_0_alloc_ip_dump(struct amdgpu_device *adev)uint32_t inst; ptr =kcalloc (reg_count,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX IP Dump\n" ); adev->gfx.ip_dump_core =NULL ; }else {
@@ -2142,7 +2142,7 @@ static void gfx_v9_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.mec.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for Compute Queues IP Dump\n" ); adev->gfx.ip_dump_compute_queues =NULL ; }else {
Signature · 1 line
2.34.1
PATCH 2/5 drm/amdgpu: fix ptr check warning in gfx10 ip_dump
In reply to Sunil KhatriChange condition, if (ptr == NULL) to if (!ptr)
for a better format and fix the warning.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -3
@@ -4648,7 +4648,7 @@ static void gfx_v10_0_alloc_ip_dump(struct amdgpu_device *adev)uint32_t inst; ptr =kcalloc (reg_count,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX IP Dump\n" ); adev->gfx.ip_dump_core =NULL ; }else {
@@ -4661,7 +4661,7 @@ static void gfx_v10_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.mec.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for Compute Queues IP Dump\n" ); adev->gfx.ip_dump_compute_queues =NULL ; }else {
@@ -4674,7 +4674,7 @@ static void gfx_v10_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.me.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX Queues IP Dump\n" ); adev->gfx.ip_dump_gfx_queues =NULL ; }else {
Signature · 1 line
2.34.1
PATCH 3/5 drm/amdgpu: fix ptr check warning in gfx11 ip_dump
In reply to Sunil KhatriChange condition, if (ptr == NULL) to if (!ptr)
for a better format and fix the warning.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -3
@@ -1502,7 +1502,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev)uint32_t inst; ptr =kcalloc (reg_count,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX IP Dump\n" ); adev->gfx.ip_dump_core =NULL ; }else {
@@ -1515,7 +1515,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.mec.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for Compute Queues IP Dump\n" ); adev->gfx.ip_dump_compute_queues =NULL ; }else {
@@ -1528,7 +1528,7 @@ static void gfx_v11_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.me.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX Queues IP Dump\n" ); adev->gfx.ip_dump_gfx_queues =NULL ; }else {
Signature · 1 line
2.34.1
PATCH 4/5 drm/amdgpu: fix ptr check warning in gfx12 ip_dump
In reply to Sunil KhatriChange condition, if (ptr == NULL) to if (!ptr)
for a better format and fix the warning.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +3 -3
@@ -1281,7 +1281,7 @@ static void gfx_v12_0_alloc_ip_dump(struct amdgpu_device *adev)uint32_t inst; ptr =kcalloc (reg_count,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX IP Dump\n" ); adev->gfx.ip_dump_core =NULL ; }else {
@@ -1294,7 +1294,7 @@ static void gfx_v12_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.mec.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for Compute Queues IP Dump\n" ); adev->gfx.ip_dump_compute_queues =NULL ; }else {
@@ -1307,7 +1307,7 @@ static void gfx_v12_0_alloc_ip_dump(struct amdgpu_device *adev) adev->gfx.me.num_queue_per_pipe; ptr =kcalloc (reg_count * inst,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for GFX Queues IP Dump\n" ); adev->gfx.ip_dump_gfx_queues =NULL ; }else {
Signature · 1 line
2.34.1
PATCH 5/5 drm/amdgpu: fix ptr check warning in vcn_v3 ip_dump
In reply to Sunil KhatriChange condition, if (ptr == NULL) to if (!ptr)
for a better format and fix the warning.
--- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1 -1
@@ -359,7 +359,7 @@ static int vcn_v3_0_sw_init(void *handle)/* Allocate memory for VCN IP Dump buffer */ ptr =kcalloc (adev->vcn.num_vcn_inst * reg_count,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for VCN IP Dump\n" ); adev->vcn.ip_dump =NULL ; }else {
Signature · 1 line
2.34.1
Re: [PATCH v1 5/5] drm/amdgpu: fix ptr check warning in vcn_v3 ip_dump
Series is:
Quoted 25 lines · Sunil Khatri
Change condition, if (ptr == NULL) to if (!ptr)
for a better format and fix the warning.Signed-off-by Sunil Khatri <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1
-2@@ -359,7 +359,7 @@ static int vcn_v3_0_sw_init(void *handle)/* Allocate memory for VCN IP Dump buffer */ ptr =kcalloc (adev->vcn.num_vcn_inst * reg_count,sizeof (uint32_t ),GFP_KERNEL ); -if (ptr ==NULL ) { +if (!ptr) {DRM_ERROR ("Failed to allocate memory for VCN IP Dump\n" ); adev->vcn.ip_dump =NULL ; }else { --2.34.1