[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_Mi+dTQOdB0QV+TNSfA+jCbFEfZ1VvRbo2GJ_NB2XKOCg@mail.gmail.com>
Date: Mon, 21 Nov 2022 12:30:30 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Ren Zhijie <renzhijie2@...wei.com>
Cc: alexander.deucher@....com, christian.koenig@....com,
airlied@...il.com, daniel@...ll.ch, yusongping@...wei.com,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
weiyongjun1@...wei.com, amd-gfx@...ts.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: fix unused-function error
Applied. Thanks!
Alex
On Mon, Nov 21, 2022 at 8:09 AM Ren Zhijie <renzhijie2@...wei.com> wrote:
>
> If CONFIG_DRM_AMDGPU=y and CONFIG_DRM_AMD_DC is not set,
> gcc complained about unused-function :
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1705:13: error: ‘amdgpu_discovery_set_sriov_display’ defined but not used [-Werror=unused-function]
> static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *adev)
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> To fix this error, use CONFIG_DRM_AMD_DC to wrap
> the definition of amdgpu_discovery_set_sriov_display().
>
> Fixes: 25263da37693 ("drm/amdgpu: rework SR-IOV virtual display handling")
> Signed-off-by: Ren Zhijie <renzhijie2@...wei.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 6b48178455bc..2509341df92d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -1702,11 +1702,13 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)
> return 0;
> }
>
> +#if defined(CONFIG_DRM_AMD_DC)
> static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *adev)
> {
> amdgpu_device_set_sriov_virtual_display(adev);
> amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block);
> }
> +#endif
>
> static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
> {
> --
> 2.17.1
>
Powered by blists - more mailing lists