linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/prime: include device.h
       [not found] <20170510081508.ornstbloztolsvf7@phenom.ffwll.local>
@ 2017-05-10 14:40 ` Laura Abbott
  2017-05-10 14:48   ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Laura Abbott @ 2017-05-10 14:40 UTC (permalink / raw)
  To: Daniel Vetter, Chris Wilson
  Cc: Laura Abbott, dri-devel, linux-kernel, intel-gfx

Explictly add linux/device.h to ensure struct device is defined:

In file included from include/drm/drm_file.h:38:0,
                 from drivers/gpu/drm/drm_file.c:38:
include/drm/drm_prime.h:71:14: warning: 'struct device' declared inside
	  parameter list will not be visible outside of this definition or
	  declaration
          struct device *attach_dev);
		 ^~~~~~

Signed-off-by: Laura Abbott <labbott@redhat.com>
---
Sorry, missed sending this out
---
 include/drm/drm_prime.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
index 46fd1fb..8ef37c8 100644
--- a/include/drm/drm_prime.h
+++ b/include/drm/drm_prime.h
@@ -35,6 +35,7 @@
 #include <linux/mutex.h>
 #include <linux/rbtree.h>
 #include <linux/scatterlist.h>
+#include <linux/device.h>
 
 /**
  * struct drm_prime_file_private - per-file tracking for PRIME
-- 
2.7.4

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

* Re: [PATCH] drm/prime: include device.h
  2017-05-10 14:40 ` [PATCH] drm/prime: include device.h Laura Abbott
@ 2017-05-10 14:48   ` Chris Wilson
  2017-05-10 17:05     ` [PATCHv2] drm/prime: Forward declare struct device Laura Abbott
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2017-05-10 14:48 UTC (permalink / raw)
  To: Laura Abbott; +Cc: Daniel Vetter, dri-devel, linux-kernel, intel-gfx

On Wed, May 10, 2017 at 07:40:01AM -0700, Laura Abbott wrote:
> Explictly add linux/device.h to ensure struct device is defined:
> 
> In file included from include/drm/drm_file.h:38:0,
>                  from drivers/gpu/drm/drm_file.c:38:
> include/drm/drm_prime.h:71:14: warning: 'struct device' declared inside
> 	  parameter list will not be visible outside of this definition or
> 	  declaration
>           struct device *attach_dev);

We aren't using it for anything other than an opaque pointer, so a
struct device;
forward decl will suffice?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* [PATCHv2] drm/prime: Forward declare struct device
  2017-05-10 14:48   ` Chris Wilson
@ 2017-05-10 17:05     ` Laura Abbott
  2017-05-10 17:13       ` Sumit Semwal
  0 siblings, 1 reply; 4+ messages in thread
From: Laura Abbott @ 2017-05-10 17:05 UTC (permalink / raw)
  To: Daniel Vetter, Chris Wilson
  Cc: Laura Abbott, dri-devel, linux-kernel, intel-gfx


We need a declaration of struct device to avoid warnings:

In file included from include/drm/drm_file.h:38:0,
                 from drivers/gpu/drm/drm_file.c:38:
include/drm/drm_prime.h:71:14: warning: 'struct device' declared inside
	  parameter list will not be visible outside of this definition or
	  declaration
          struct device *attach_dev);
		 ^~~~~~

Forward declare it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
---
v2: Switch to foward declaration instead of including a header.
---
 include/drm/drm_prime.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
index 46fd1fb..59ccab4 100644
--- a/include/drm/drm_prime.h
+++ b/include/drm/drm_prime.h
@@ -50,6 +50,8 @@ struct drm_prime_file_private {
 	struct rb_root handles;
 };
 
+struct device;
+
 struct dma_buf_export_info;
 struct dma_buf;
 
-- 
2.7.4

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

* Re: [PATCHv2] drm/prime: Forward declare struct device
  2017-05-10 17:05     ` [PATCHv2] drm/prime: Forward declare struct device Laura Abbott
@ 2017-05-10 17:13       ` Sumit Semwal
  0 siblings, 0 replies; 4+ messages in thread
From: Sumit Semwal @ 2017-05-10 17:13 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Daniel Vetter, Chris Wilson, DRI mailing list, LKML,
	Intel Graphics Development

Hi Laura,

On 10 May 2017 at 22:35, Laura Abbott <labbott@redhat.com> wrote:
>
> We need a declaration of struct device to avoid warnings:
>
> In file included from include/drm/drm_file.h:38:0,
>                  from drivers/gpu/drm/drm_file.c:38:
> include/drm/drm_prime.h:71:14: warning: 'struct device' declared inside
>           parameter list will not be visible outside of this definition or
>           declaration
>           struct device *attach_dev);
>                  ^~~~~~
>
> Forward declare it.
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
Thanks for the patch; feel free to add my
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>

> ---
> v2: Switch to foward declaration instead of including a header.
> ---
>  include/drm/drm_prime.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
> index 46fd1fb..59ccab4 100644
> --- a/include/drm/drm_prime.h
> +++ b/include/drm/drm_prime.h
> @@ -50,6 +50,8 @@ struct drm_prime_file_private {
>         struct rb_root handles;
>  };
>
> +struct device;
> +
>  struct dma_buf_export_info;
>  struct dma_buf;
>
> --
> 2.7.4
>

Best,
Sumit.

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

end of thread, other threads:[~2017-05-10 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170510081508.ornstbloztolsvf7@phenom.ffwll.local>
2017-05-10 14:40 ` [PATCH] drm/prime: include device.h Laura Abbott
2017-05-10 14:48   ` Chris Wilson
2017-05-10 17:05     ` [PATCHv2] drm/prime: Forward declare struct device Laura Abbott
2017-05-10 17:13       ` Sumit Semwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).