[PATCH v1 5/5] drm/amdgpu: fix ptr check warning in vcn_v3 ip_dump
Alex Deucher
alexdeucher at gmail.com
Thu Aug 8 16:00:23 UTC 2024
Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
On Wed, Aug 7, 2024 at 8:02 AM Sunil Khatri <sunil.khatri at amd.com> wrote:
>
> Change condition, if (ptr == NULL) to if (!ptr)
> for a better format and fix the warning.
>
> Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> index c2278cc49dd5..6d74da7b7ffb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> @@ -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
>
More information about the amd-gfx
mailing list