Re: [PATCH v1 5/5] drm/amdgpu: fix ptr check warning in vcn_v3 ip_dump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Series is:
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

On Wed, Aug 7, 2024 at 8:02 AM Sunil Khatri <sunil.khatri@xxxxxxx> wrote:
>
> Change condition, if (ptr == NULL) to if (!ptr)
> for a better format and fix the warning.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@xxxxxxx>
> ---
>  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
>




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux