All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix unused-function error
@ 2022-11-21 13:04 ` Ren Zhijie
  0 siblings, 0 replies; 5+ messages in thread
From: Ren Zhijie @ 2022-11-21 13:04 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, weiyongjun1, yusongping, renzhijie2

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@huawei.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] drm/amdgpu: fix unused-function error
@ 2022-11-21 13:04 ` Ren Zhijie
  0 siblings, 0 replies; 5+ messages in thread
From: Ren Zhijie @ 2022-11-21 13:04 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, airlied, daniel
  Cc: yusongping, linux-kernel, dri-devel, renzhijie2, weiyongjun1, amd-gfx

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@huawei.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: fix unused-function error
  2022-11-21 13:04 ` Ren Zhijie
  (?)
@ 2022-11-21 17:30   ` Alex Deucher
  -1 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2022-11-21 17:30 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: alexander.deucher, christian.koenig, airlied, daniel, yusongping,
	linux-kernel, dri-devel, weiyongjun1, amd-gfx

Applied.  Thanks!

Alex

On Mon, Nov 21, 2022 at 8:09 AM Ren Zhijie <renzhijie2@huawei.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@huawei.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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: fix unused-function error
@ 2022-11-21 17:30   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2022-11-21 17:30 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: yusongping, linux-kernel, dri-devel, weiyongjun1, amd-gfx,
	alexander.deucher, christian.koenig

Applied.  Thanks!

Alex

On Mon, Nov 21, 2022 at 8:09 AM Ren Zhijie <renzhijie2@huawei.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@huawei.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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: fix unused-function error
@ 2022-11-21 17:30   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2022-11-21 17:30 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: yusongping, linux-kernel, dri-devel, weiyongjun1, amd-gfx,
	daniel, alexander.deucher, airlied, christian.koenig

Applied.  Thanks!

Alex

On Mon, Nov 21, 2022 at 8:09 AM Ren Zhijie <renzhijie2@huawei.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@huawei.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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-21 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 13:04 [PATCH] drm/amdgpu: fix unused-function error Ren Zhijie
2022-11-21 13:04 ` Ren Zhijie
2022-11-21 17:30 ` Alex Deucher
2022-11-21 17:30   ` Alex Deucher
2022-11-21 17:30   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.