public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: hugetlb.c make functions static, use NULL rather than 0
@ 2008-08-22 22:47 Harvey Harrison
  2008-08-25  9:27 ` Hugh Dickins
  0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-08-22 22:47 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: Andrew Morton, LKML

mm/hugetlb.c:265:17: warning: symbol 'resv_map_alloc' was not declared. Should it be static?
mm/hugetlb.c:277:6: warning: symbol 'resv_map_release' was not declared. Should it be static?
mm/hugetlb.c:292:9: warning: Using plain integer as NULL pointer
mm/hugetlb.c:1750:5: warning: symbol 'unmap_ref_private' was not declared. Should it be static?

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 mm/hugetlb.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 67a7119..b548a94 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -262,7 +262,7 @@ struct resv_map {
 	struct list_head regions;
 };
 
-struct resv_map *resv_map_alloc(void)
+static struct resv_map *resv_map_alloc(void)
 {
 	struct resv_map *resv_map = kmalloc(sizeof(*resv_map), GFP_KERNEL);
 	if (!resv_map)
@@ -274,7 +274,7 @@ struct resv_map *resv_map_alloc(void)
 	return resv_map;
 }
 
-void resv_map_release(struct kref *ref)
+static void resv_map_release(struct kref *ref)
 {
 	struct resv_map *resv_map = container_of(ref, struct resv_map, refs);
 
@@ -289,7 +289,7 @@ static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
 	if (!(vma->vm_flags & VM_SHARED))
 		return (struct resv_map *)(get_vma_private_data(vma) &
 							~HPAGE_RESV_MASK);
-	return 0;
+	return NULL;
 }
 
 static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
@@ -1747,7 +1747,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
  * from other VMAs and let the children be SIGKILLed if they are faulting the
  * same region.
  */
-int unmap_ref_private(struct mm_struct *mm,
+static int unmap_ref_private(struct mm_struct *mm,
 					struct vm_area_struct *vma,
 					struct page *page,
 					unsigned long address)
-- 
1.6.0.340.g84854




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

* Re: [PATCH] mm: hugetlb.c make functions static, use NULL rather than 0
  2008-08-22 22:47 [PATCH] mm: hugetlb.c make functions static, use NULL rather than 0 Harvey Harrison
@ 2008-08-25  9:27 ` Hugh Dickins
  2008-08-29  8:29   ` Andy Whitcroft
  0 siblings, 1 reply; 4+ messages in thread
From: Hugh Dickins @ 2008-08-25  9:27 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andy Whitcroft, Andrew Morton, LKML

On Fri, 22 Aug 2008, Harvey Harrison wrote:

> mm/hugetlb.c:265:17: warning: symbol 'resv_map_alloc' was not declared. Should it be static?
> mm/hugetlb.c:277:6: warning: symbol 'resv_map_release' was not declared. Should it be static?
> mm/hugetlb.c:292:9: warning: Using plain integer as NULL pointer
> mm/hugetlb.c:1750:5: warning: symbol 'unmap_ref_private' was not declared. Should it be static?
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

This all looks good to me, but guess you sent it my way because
you mistook it for mm/hughtlb.c?  Cc'ed Andy, he's the man here!

Hugh

> ---
>  mm/hugetlb.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 67a7119..b548a94 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -262,7 +262,7 @@ struct resv_map {
>  	struct list_head regions;
>  };
>  
> -struct resv_map *resv_map_alloc(void)
> +static struct resv_map *resv_map_alloc(void)
>  {
>  	struct resv_map *resv_map = kmalloc(sizeof(*resv_map), GFP_KERNEL);
>  	if (!resv_map)
> @@ -274,7 +274,7 @@ struct resv_map *resv_map_alloc(void)
>  	return resv_map;
>  }
>  
> -void resv_map_release(struct kref *ref)
> +static void resv_map_release(struct kref *ref)
>  {
>  	struct resv_map *resv_map = container_of(ref, struct resv_map, refs);
>  
> @@ -289,7 +289,7 @@ static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
>  	if (!(vma->vm_flags & VM_SHARED))
>  		return (struct resv_map *)(get_vma_private_data(vma) &
>  							~HPAGE_RESV_MASK);
> -	return 0;
> +	return NULL;
>  }
>  
>  static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
> @@ -1747,7 +1747,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
>   * from other VMAs and let the children be SIGKILLed if they are faulting the
>   * same region.
>   */
> -int unmap_ref_private(struct mm_struct *mm,
> +static int unmap_ref_private(struct mm_struct *mm,
>  					struct vm_area_struct *vma,
>  					struct page *page,
>  					unsigned long address)
> -- 
> 1.6.0.340.g84854

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

* Re: [PATCH] mm: hugetlb.c make functions static, use NULL rather than 0
  2008-08-25  9:27 ` Hugh Dickins
@ 2008-08-29  8:29   ` Andy Whitcroft
  2008-08-29  8:48     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Whitcroft @ 2008-08-29  8:29 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Hugh Dickins, Andrew Morton, LKML

On Mon, Aug 25, 2008 at 10:27:39AM +0100, Hugh Dickins wrote:
> On Fri, 22 Aug 2008, Harvey Harrison wrote:
> 
> > mm/hugetlb.c:265:17: warning: symbol 'resv_map_alloc' was not declared. Should it be static?
> > mm/hugetlb.c:277:6: warning: symbol 'resv_map_release' was not declared. Should it be static?
> > mm/hugetlb.c:292:9: warning: Using plain integer as NULL pointer
> > mm/hugetlb.c:1750:5: warning: symbol 'unmap_ref_private' was not declared. Should it be static?

Harvey are you using some additional compiler flags to get this, I am
pretty sure I checked for warnings during compilation before this lot
was merged.  Hmmm.

> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

Yep this looks completely sane.  This appears to have been sucked up
into -mm already, but for completeness.

Acked-by: Andy Whitcroft <apw@shadowen.org>

> This all looks good to me, but guess you sent it my way because
> you mistook it for mm/hughtlb.c?  Cc'ed Andy, he's the man here!

Thanks for the heads up.

> Hugh
> 
> > ---
> >  mm/hugetlb.c |    8 ++++----
> >  1 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > index 67a7119..b548a94 100644
> > --- a/mm/hugetlb.c
> > +++ b/mm/hugetlb.c
> > @@ -262,7 +262,7 @@ struct resv_map {
> >  	struct list_head regions;
> >  };
> >  
> > -struct resv_map *resv_map_alloc(void)
> > +static struct resv_map *resv_map_alloc(void)
> >  {
> >  	struct resv_map *resv_map = kmalloc(sizeof(*resv_map), GFP_KERNEL);
> >  	if (!resv_map)
> > @@ -274,7 +274,7 @@ struct resv_map *resv_map_alloc(void)
> >  	return resv_map;
> >  }
> >  
> > -void resv_map_release(struct kref *ref)
> > +static void resv_map_release(struct kref *ref)
> >  {
> >  	struct resv_map *resv_map = container_of(ref, struct resv_map, refs);
> >  
> > @@ -289,7 +289,7 @@ static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
> >  	if (!(vma->vm_flags & VM_SHARED))
> >  		return (struct resv_map *)(get_vma_private_data(vma) &
> >  							~HPAGE_RESV_MASK);
> > -	return 0;
> > +	return NULL;
> >  }
> >  
> >  static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
> > @@ -1747,7 +1747,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
> >   * from other VMAs and let the children be SIGKILLed if they are faulting the
> >   * same region.
> >   */
> > -int unmap_ref_private(struct mm_struct *mm,
> > +static int unmap_ref_private(struct mm_struct *mm,
> >  					struct vm_area_struct *vma,
> >  					struct page *page,
> >  					unsigned long address)
> > -- 
> > 1.6.0.340.g84854

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

* Re: [PATCH] mm: hugetlb.c make functions static, use NULL rather than 0
  2008-08-29  8:29   ` Andy Whitcroft
@ 2008-08-29  8:48     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2008-08-29  8:48 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Harvey Harrison, Hugh Dickins, LKML

On Fri, 29 Aug 2008 09:29:50 +0100 Andy Whitcroft <apw@shadowen.org> wrote:

> On Mon, Aug 25, 2008 at 10:27:39AM +0100, Hugh Dickins wrote:
> > On Fri, 22 Aug 2008, Harvey Harrison wrote:
> > 
> > > mm/hugetlb.c:265:17: warning: symbol 'resv_map_alloc' was not declared. Should it be static?
> > > mm/hugetlb.c:277:6: warning: symbol 'resv_map_release' was not declared. Should it be static?
> > > mm/hugetlb.c:292:9: warning: Using plain integer as NULL pointer
> > > mm/hugetlb.c:1750:5: warning: symbol 'unmap_ref_private' was not declared. Should it be static?
> 
> Harvey are you using some additional compiler flags to get this, I am
> pretty sure I checked for warnings during compilation before this lot
> was merged.  Hmmm.

sparse.   `make C=1'

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

end of thread, other threads:[~2008-08-29  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-22 22:47 [PATCH] mm: hugetlb.c make functions static, use NULL rather than 0 Harvey Harrison
2008-08-25  9:27 ` Hugh Dickins
2008-08-29  8:29   ` Andy Whitcroft
2008-08-29  8:48     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox