Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506427 > unrolled thread

[PATCH 3/3] drm/amdgpu: move function declaration to header file

Started byBaoyou Xie <baoyou.xie@linaro.org>
First post2016-10-22 10:50 +0200
Last post2016-10-24 18:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] drm/amdgpu: move function declaration to header file Baoyou Xie <baoyou.xie@linaro.org> - 2016-10-22 10:50 +0200
    Re: [PATCH 3/3] drm/amdgpu: move function declaration to header file Alex Deucher <alexdeucher@gmail.com> - 2016-10-24 18:30 +0200

#1506427 — [PATCH 3/3] drm/amdgpu: move function declaration to header file

FromBaoyou Xie <baoyou.xie@linaro.org>
Date2016-10-22 10:50 +0200
Subject[PATCH 3/3] drm/amdgpu: move function declaration to header file
Message-ID<sv0a6-15J-37@gated-at.bofh.it>
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:37:6: warning: no previous prototype for 'amdgpu_pm_acpi_event_handler' [-Wmissing-prototypes]

In fact, this function is defined in
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c, but should be declared
in a header file. So this patch moves the function declaration
to drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h      | 2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 039b57e..c0bc42b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -2145,6 +2145,8 @@ void amdgpu_io_wreg(struct amdgpu_device *adev, u32 reg, u32 v);
 u32 amdgpu_mm_rdoorbell(struct amdgpu_device *adev, u32 index);
 void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v);
 
+void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
+
 /*
  * Registers read & write functions.
  */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 5796539..d77d630 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -33,7 +33,6 @@
 #include "amd_acpi.h"
 #include "atom.h"
 
-extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
 /* Call the ATIF method
  */
 /**
-- 
2.7.4

[toc] | [next] | [standalone]


#1507371

FromAlex Deucher <alexdeucher@gmail.com>
Date2016-10-24 18:30 +0200
Message-ID<svQim-1Di-27@gated-at.bofh.it>
In reply to#1506427

[Multipart message — attachments visible in raw view] — view raw

On Sat, Oct 22, 2016 at 4:48 AM, Baoyou Xie <baoyou.xie@linaro.org> wrote:
> We get 1 warning when building kernel with W=1:
> drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:37:6: warning: no previous prototype for 'amdgpu_pm_acpi_event_handler' [-Wmissing-prototypes]
>
> In fact, this function is defined in
> drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c, but should be declared
> in a header file. So this patch moves the function declaration
> to drivers/gpu/drm/amd/amdgpu/amdgpu.h.

I want to try and avoid making amdgpu.h a random dumping ground for
function defs.  Let's put it in amdgpu_pm.h instead.  How about the
attached patch?

Alex


>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h      | 2 ++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 -
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 039b57e..c0bc42b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -2145,6 +2145,8 @@ void amdgpu_io_wreg(struct amdgpu_device *adev, u32 reg, u32 v);
>  u32 amdgpu_mm_rdoorbell(struct amdgpu_device *adev, u32 index);
>  void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v);
>
> +void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
> +
>  /*
>   * Registers read & write functions.
>   */
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 5796539..d77d630 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -33,7 +33,6 @@
>  #include "amd_acpi.h"
>  #include "atom.h"
>
> -extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
>  /* Call the ATIF method
>   */
>  /**
> --
> 2.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web