On 3/28/2025 2:08 AM, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limoncie...@amd.com>
> 
> checkpatch.pl complains about unnecessary error messages for failing
> to allocate memory. These aren't needed when the return code is -ENOMEM.

It's not about the error code. It conveys till what stage driver
proceeded and when the failure happened. I do see other instances in
kernel which do give an error message with -ENOMEM.

Thanks,
Lijo

> Drop such a message from amdgpu_acpi_enumerate_xcc().
> 
> Signed-off-by: Mario Limonciello <mario.limoncie...@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 1c5994de5a723..840901d65fed7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -1116,10 +1116,8 @@ static int amdgpu_acpi_enumerate_xcc(void)
>  
>               xcc_info = kzalloc(sizeof(struct amdgpu_acpi_xcc_info),
>                                  GFP_KERNEL);
> -             if (!xcc_info) {
> -                     DRM_ERROR("Failed to allocate memory for xcc info\n");
> +             if (!xcc_info)
>                       return -ENOMEM;
> -             }
>  
>               INIT_LIST_HEAD(&xcc_info->list);
>               xcc_info->handle = acpi_device_handle(acpi_dev);

Reply via email to