linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: fix -Wmissing-prototypes warnings
@ 2019-08-28  7:42 Yi Wang
  2019-09-09  7:52 ` David Hildenbrand
  0 siblings, 1 reply; 3+ messages in thread
From: Yi Wang @ 2019-08-28  7:42 UTC (permalink / raw)
  To: akpm
  Cc: keescook, dan.j.williams, wang.yi59, cai, linux-mm, linux-kernel,
	osalvador, mhocko, rppt, david, richardw.yang, xue.zhihong,
	up2wing, wang.liang82

We get two warnings when build kernel W=1:
mm/shuffle.c:36:12: warning: no previous prototype for ‘shuffle_show’
[-Wmissing-prototypes]
mm/sparse.c:220:6: warning: no previous prototype for
‘subsection_mask_set’ [-Wmissing-prototypes]

Make the function static to fix this.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 mm/shuffle.c | 2 +-
 mm/sparse.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/shuffle.c b/mm/shuffle.c
index 3ce1248..b3fe97f 100644
--- a/mm/shuffle.c
+++ b/mm/shuffle.c
@@ -33,7 +33,7 @@ __meminit void page_alloc_shuffle(enum mm_shuffle_ctl ctl)
 }
 
 static bool shuffle_param;
-extern int shuffle_show(char *buffer, const struct kernel_param *kp)
+static int shuffle_show(char *buffer, const struct kernel_param *kp)
 {
 	return sprintf(buffer, "%c\n", test_bit(SHUFFLE_ENABLE, &shuffle_state)
 			? 'Y' : 'N');
diff --git a/mm/sparse.c b/mm/sparse.c
index 72f010d..49006dd 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -217,7 +217,7 @@ static inline unsigned long first_present_section_nr(void)
 	return next_present_section_nr(-1);
 }
 
-void subsection_mask_set(unsigned long *map, unsigned long pfn,
+static void subsection_mask_set(unsigned long *map, unsigned long pfn,
 		unsigned long nr_pages)
 {
 	int idx = subsection_map_index(pfn);
-- 
1.8.3.1


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

* Re: [PATCH] mm: fix -Wmissing-prototypes warnings
  2019-08-28  7:42 [PATCH] mm: fix -Wmissing-prototypes warnings Yi Wang
@ 2019-09-09  7:52 ` David Hildenbrand
  2019-09-23 23:20   ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2019-09-09  7:52 UTC (permalink / raw)
  To: Yi Wang, akpm
  Cc: keescook, dan.j.williams, cai, linux-mm, linux-kernel, osalvador,
	mhocko, rppt, richardw.yang, xue.zhihong, up2wing, wang.liang82

On 28.08.19 09:42, Yi Wang wrote:
> We get two warnings when build kernel W=1:
> mm/shuffle.c:36:12: warning: no previous prototype for ‘shuffle_show’
> [-Wmissing-prototypes]
> mm/sparse.c:220:6: warning: no previous prototype for
> ‘subsection_mask_set’ [-Wmissing-prototypes]
> 
> Make the function static to fix this.
> 
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> ---
>  mm/shuffle.c | 2 +-
>  mm/sparse.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/shuffle.c b/mm/shuffle.c
> index 3ce1248..b3fe97f 100644
> --- a/mm/shuffle.c
> +++ b/mm/shuffle.c
> @@ -33,7 +33,7 @@ __meminit void page_alloc_shuffle(enum mm_shuffle_ctl ctl)
>  }
>  
>  static bool shuffle_param;
> -extern int shuffle_show(char *buffer, const struct kernel_param *kp)
> +static int shuffle_show(char *buffer, const struct kernel_param *kp)
>  {
>  	return sprintf(buffer, "%c\n", test_bit(SHUFFLE_ENABLE, &shuffle_state)
>  			? 'Y' : 'N');
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 72f010d..49006dd 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -217,7 +217,7 @@ static inline unsigned long first_present_section_nr(void)
>  	return next_present_section_nr(-1);
>  }
>  
> -void subsection_mask_set(unsigned long *map, unsigned long pfn,
> +static void subsection_mask_set(unsigned long *map, unsigned long pfn,
>  		unsigned long nr_pages)
>  {
>  	int idx = subsection_map_index(pfn);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

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

* Re: [PATCH] mm: fix -Wmissing-prototypes warnings
  2019-09-09  7:52 ` David Hildenbrand
@ 2019-09-23 23:20   ` Kees Cook
  0 siblings, 0 replies; 3+ messages in thread
From: Kees Cook @ 2019-09-23 23:20 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Yi Wang, akpm, dan.j.williams, cai, linux-mm, linux-kernel,
	osalvador, mhocko, rppt, richardw.yang, xue.zhihong, up2wing,
	wang.liang82

On Mon, Sep 09, 2019 at 09:52:40AM +0200, David Hildenbrand wrote:
> On 28.08.19 09:42, Yi Wang wrote:
> > We get two warnings when build kernel W=1:
> > mm/shuffle.c:36:12: warning: no previous prototype for ‘shuffle_show’
> > [-Wmissing-prototypes]
> > mm/sparse.c:220:6: warning: no previous prototype for
> > ‘subsection_mask_set’ [-Wmissing-prototypes]
> > 
> > Make the function static to fix this.
> > 
> > Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> > ---
> >  mm/shuffle.c | 2 +-
> >  mm/sparse.c  | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/mm/shuffle.c b/mm/shuffle.c
> > index 3ce1248..b3fe97f 100644
> > --- a/mm/shuffle.c
> > +++ b/mm/shuffle.c
> > @@ -33,7 +33,7 @@ __meminit void page_alloc_shuffle(enum mm_shuffle_ctl ctl)
> >  }
> >  
> >  static bool shuffle_param;
> > -extern int shuffle_show(char *buffer, const struct kernel_param *kp)
> > +static int shuffle_show(char *buffer, const struct kernel_param *kp)
> >  {
> >  	return sprintf(buffer, "%c\n", test_bit(SHUFFLE_ENABLE, &shuffle_state)
> >  			? 'Y' : 'N');
> > diff --git a/mm/sparse.c b/mm/sparse.c
> > index 72f010d..49006dd 100644
> > --- a/mm/sparse.c
> > +++ b/mm/sparse.c
> > @@ -217,7 +217,7 @@ static inline unsigned long first_present_section_nr(void)
> >  	return next_present_section_nr(-1);
> >  }
> >  
> > -void subsection_mask_set(unsigned long *map, unsigned long pfn,
> > +static void subsection_mask_set(unsigned long *map, unsigned long pfn,
> >  		unsigned long nr_pages)
> >  {
> >  	int idx = subsection_map_index(pfn);
> > 
> 
> Reviewed-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

Andrew, can you take this?

-- 
Kees Cook

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

end of thread, other threads:[~2019-09-23 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  7:42 [PATCH] mm: fix -Wmissing-prototypes warnings Yi Wang
2019-09-09  7:52 ` David Hildenbrand
2019-09-23 23:20   ` Kees Cook

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).