2018-04-24 14:36:57

by Luc Van Oostenryck

[permalink] [raw]
Subject: [PATCH] drm/amdgpu: fix amdgpu_atpx_get_client_id()'s return type

The method struct vga_switcheroo_handler::get_client_id() is defined
as returning an 'enum vga_switcheroo_client_id' but the implementation
in this driver, amdgpu_atpx_get_client_id(), returns an 'int'.

Fix this by returning 'enum vga_switcheroo_client_id' in this driver too.

Signed-off-by: Luc Van Oostenryck <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index 1ae5ae8c4..1bcb2b247 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -550,7 +550,7 @@ static int amdgpu_atpx_init(void)
* look up whether we are the integrated or discrete GPU (all asics).
* Returns the client id.
*/
-static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
+static enum vga_switcheroo_client_id amdgpu_atpx_get_client_id(struct pci_dev *pdev)
{
if (amdgpu_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev))
return VGA_SWITCHEROO_IGD;
--
2.17.0



2018-04-25 06:31:54

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] drm/amdgpu: fix amdgpu_atpx_get_client_id()'s return type

On Tue, Apr 24, 2018 at 9:15 AM, Luc Van Oostenryck
<[email protected]> wrote:
> The method struct vga_switcheroo_handler::get_client_id() is defined
> as returning an 'enum vga_switcheroo_client_id' but the implementation
> in this driver, amdgpu_atpx_get_client_id(), returns an 'int'.
>
> Fix this by returning 'enum vga_switcheroo_client_id' in this driver too.
>
> Signed-off-by: Luc Van Oostenryck <[email protected]>

Applied the whole set for radeon and amdgpu. Thanks!

Alex

> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> index 1ae5ae8c4..1bcb2b247 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> @@ -550,7 +550,7 @@ static int amdgpu_atpx_init(void)
> * look up whether we are the integrated or discrete GPU (all asics).
> * Returns the client id.
> */
> -static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
> +static enum vga_switcheroo_client_id amdgpu_atpx_get_client_id(struct pci_dev *pdev)
> {
> if (amdgpu_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev))
> return VGA_SWITCHEROO_IGD;
> --
> 2.17.0
>
> _______________________________________________
> amd-gfx mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx