All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] metag/pgtable: Fix undeclared vm_area_struct warning
@ 2017-05-10 15:36 James Hogan
       [not found] ` <20170510153620.28133-1-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: James Hogan @ 2017-05-10 15:36 UTC (permalink / raw)
  To: linux-metag-u79uwXL29TY76Z2rM5mHXA; +Cc: James Hogan, Michal Hocko

Since commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users"),
linux/vmalloc.h includes asm/pgtable.h prior to declaring struct
vm_area_struct, resulting in warnings such as the following on metag:

In file included from ./include/linux/vmalloc.h:10,
                from lib/ioremap.c:9:
./arch/metag/include/asm/pgtable.h:221: warning: ‘struct vm_area_struct’ declared inside parameter list
./arch/metag/include/asm/pgtable.h:221: warning: its scope is only this definition or declaration, which is probably not what you want

Metag's asm/pgtable.h doesn't actually need the definition of struct
vm_area_struct, so just declare struct vm_area_struct in the header
rather than including linux/mm_types.h.

Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
Signed-off-by: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Cc: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
 arch/metag/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/metag/include/asm/pgtable.h b/arch/metag/include/asm/pgtable.h
index ffa3a3a2ecad..4ccb81943ca4 100644
--- a/arch/metag/include/asm/pgtable.h
+++ b/arch/metag/include/asm/pgtable.h
@@ -88,6 +88,8 @@
 
 #include <asm/page.h>
 
+struct vm_area_struct;		/* vma defining user mapping in mm_types.h */
+
 /* zero page used for uninitialized stuff */
 extern unsigned long empty_zero_page;
 #define ZERO_PAGE(vaddr)	(virt_to_page(empty_zero_page))
-- 
2.12.2

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

* Re: [PATCH] metag/pgtable: Fix undeclared vm_area_struct warning
       [not found] ` <20170510153620.28133-1-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
@ 2017-05-11  7:39   ` Michal Hocko
       [not found]     ` <20170511073915.GC26782-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Hocko @ 2017-05-11  7:39 UTC (permalink / raw)
  To: James Hogan; +Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA

On Wed 10-05-17 16:36:20, James Hogan wrote:
> Since commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users"),
> linux/vmalloc.h includes asm/pgtable.h prior to declaring struct
> vm_area_struct, resulting in warnings such as the following on metag:
> 
> In file included from ./include/linux/vmalloc.h:10,
>                 from lib/ioremap.c:9:
> ./arch/metag/include/asm/pgtable.h:221: warning: ‘struct vm_area_struct’ declared inside parameter list
> ./arch/metag/include/asm/pgtable.h:221: warning: its scope is only this definition or declaration, which is probably not what you want
> 
> Metag's asm/pgtable.h doesn't actually need the definition of struct
> vm_area_struct, so just declare struct vm_area_struct in the header
> rather than including linux/mm_types.h.

This will be fixed in a different way [1]. It just waits for Andrew to
send the patch to Linus.

[1] http://lkml.kernel.org/r/20170509153702.GR6481-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org

Thanks for the fix anyway!

> 
> Fixes: 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> Signed-off-by: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
> Cc: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
> Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
>  arch/metag/include/asm/pgtable.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/metag/include/asm/pgtable.h b/arch/metag/include/asm/pgtable.h
> index ffa3a3a2ecad..4ccb81943ca4 100644
> --- a/arch/metag/include/asm/pgtable.h
> +++ b/arch/metag/include/asm/pgtable.h
> @@ -88,6 +88,8 @@
>  
>  #include <asm/page.h>
>  
> +struct vm_area_struct;		/* vma defining user mapping in mm_types.h */
> +
>  /* zero page used for uninitialized stuff */
>  extern unsigned long empty_zero_page;
>  #define ZERO_PAGE(vaddr)	(virt_to_page(empty_zero_page))
> -- 
> 2.12.2

-- 
Michal Hocko
SUSE Labs

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

* Re: [PATCH] metag/pgtable: Fix undeclared vm_area_struct warning
       [not found]     ` <20170511073915.GC26782-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
@ 2017-05-11  8:14       ` James Hogan
  0 siblings, 0 replies; 3+ messages in thread
From: James Hogan @ 2017-05-11  8:14 UTC (permalink / raw)
  To: Michal Hocko; +Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Hi Michal,

On Thu, May 11, 2017 at 09:39:15AM +0200, Michal Hocko wrote:
> On Wed 10-05-17 16:36:20, James Hogan wrote:
> > Since commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users"),
> > linux/vmalloc.h includes asm/pgtable.h prior to declaring struct
> > vm_area_struct, resulting in warnings such as the following on metag:
> > 
> > In file included from ./include/linux/vmalloc.h:10,
> >                 from lib/ioremap.c:9:
> > ./arch/metag/include/asm/pgtable.h:221: warning: ‘struct vm_area_struct’ declared inside parameter list
> > ./arch/metag/include/asm/pgtable.h:221: warning: its scope is only this definition or declaration, which is probably not what you want
> > 
> > Metag's asm/pgtable.h doesn't actually need the definition of struct
> > vm_area_struct, so just declare struct vm_area_struct in the header
> > rather than including linux/mm_types.h.
> 
> This will be fixed in a different way [1]. It just waits for Andrew to
> send the patch to Linus.
> 
> [1] http://lkml.kernel.org/r/20170509153702.GR6481-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org

Okay cool. I'll drop this patch then.

Thanks
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-05-11  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 15:36 [PATCH] metag/pgtable: Fix undeclared vm_area_struct warning James Hogan
     [not found] ` <20170510153620.28133-1-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2017-05-11  7:39   ` Michal Hocko
     [not found]     ` <20170511073915.GC26782-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-05-11  8:14       ` James Hogan

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.