public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging/android/lowmemorykiller: fix module param errors
@ 2009-07-31 18:10 Randy Dunlap
  2009-07-31 18:14 ` Robert P. J. Day
  2009-08-10 19:34 ` patch staging-android-lowmemorykiller-fix-module-param-errors.patch added to gregkh-2.6 tree gregkh
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2009-07-31 18:10 UTC (permalink / raw)
  To: lkml; +Cc: devel, gregkh

From: Randy Dunlap <randy.dunlap@oracle.com>

Move module_params to near the end of the source file so that
their references are already known/defined.  Fixes build errors:

drivers/staging/android/lowmemorykiller.c: In function '__check_cost':
drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared (first use in this function)
drivers/staging/android/lowmemorykiller.c: At top level:
drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared here (not in a function)
drivers/staging/android/lowmemorykiller.c:60: warning: type defaults to 'int' in declaration of 'type name'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/staging/android/lowmemorykiller.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- linux-next-20090731.orig/drivers/staging/android/lowmemorykiller.c
+++ linux-next-20090731/drivers/staging/android/lowmemorykiller.c
@@ -57,13 +57,6 @@ static int lowmem_minfree_size = 4;
 			printk(x);			\
 	} while (0)
 
-module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
-module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
-			 S_IRUGO | S_IWUSR);
-module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
-			 S_IRUGO | S_IWUSR);
-module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
-
 static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
 {
 	struct task_struct *p;
@@ -166,6 +159,13 @@ static void __exit lowmem_exit(void)
 	unregister_shrinker(&lowmem_shrinker);
 }
 
+module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
+module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
+			 S_IRUGO | S_IWUSR);
+module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
+			 S_IRUGO | S_IWUSR);
+module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
+
 module_init(lowmem_init);
 module_exit(lowmem_exit);
 



---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

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

* Re: [PATCH] staging/android/lowmemorykiller: fix module param errors
  2009-07-31 18:10 [PATCH] staging/android/lowmemorykiller: fix module param errors Randy Dunlap
@ 2009-07-31 18:14 ` Robert P. J. Day
  2009-07-31 18:22   ` Randy Dunlap
  2009-08-10 19:34 ` patch staging-android-lowmemorykiller-fix-module-param-errors.patch added to gregkh-2.6 tree gregkh
  1 sibling, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2009-07-31 18:14 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, devel, gregkh

On Fri, 31 Jul 2009, Randy Dunlap wrote:

> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Move module_params to near the end of the source file so that
> their references are already known/defined.  Fixes build errors:
>
> drivers/staging/android/lowmemorykiller.c: In function '__check_cost':
> drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared (first use in this function)
> drivers/staging/android/lowmemorykiller.c: At top level:
> drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared here (not in a function)
> drivers/staging/android/lowmemorykiller.c:60: warning: type defaults to 'int' in declaration of 'type name'
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  drivers/staging/android/lowmemorykiller.c |   14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> --- linux-next-20090731.orig/drivers/staging/android/lowmemorykiller.c
> +++ linux-next-20090731/drivers/staging/android/lowmemorykiller.c
> @@ -57,13 +57,6 @@ static int lowmem_minfree_size = 4;
>  			printk(x);			\
>  	} while (0)
>
> -module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
> -module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
> -			 S_IRUGO | S_IWUSR);
> -module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
> -			 S_IRUGO | S_IWUSR);
> -module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
> -
>  static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
>  {
>  	struct task_struct *p;
> @@ -166,6 +159,13 @@ static void __exit lowmem_exit(void)
>  	unregister_shrinker(&lowmem_shrinker);
>  }
>
> +module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
> +module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
> +			 S_IRUGO | S_IWUSR);
> +module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
> +			 S_IRUGO | S_IWUSR);
> +module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
> +
>  module_init(lowmem_init);
>  module_exit(lowmem_exit);

  isn't that a bit non-standard?  from what i've seen, the standard
seems to be to define something as a module parameter *immediately*
after its definition, not to collect them all at the bottom of the
source file separate from the definitions.  *is* there a standard for
that?

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
"Kernel Newbie Corner" column @ linux.com:          http://cli.gs/WG6WYX
========================================================================

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

* Re: [PATCH] staging/android/lowmemorykiller: fix module param errors
  2009-07-31 18:14 ` Robert P. J. Day
@ 2009-07-31 18:22   ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2009-07-31 18:22 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: lkml, devel, gregkh

On Fri, 31 Jul 2009 14:14:57 -0400 (EDT) Robert P. J. Day wrote:

> On Fri, 31 Jul 2009, Randy Dunlap wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > Move module_params to near the end of the source file so that
> > their references are already known/defined.  Fixes build errors:
> >
> > drivers/staging/android/lowmemorykiller.c: In function '__check_cost':
> > drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared (first use in this function)
> > drivers/staging/android/lowmemorykiller.c: At top level:
> > drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared here (not in a function)
> > drivers/staging/android/lowmemorykiller.c:60: warning: type defaults to 'int' in declaration of 'type name'
> >
> > Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> > ---
> >  drivers/staging/android/lowmemorykiller.c |   14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > --- linux-next-20090731.orig/drivers/staging/android/lowmemorykiller.c
> > +++ linux-next-20090731/drivers/staging/android/lowmemorykiller.c
> > @@ -57,13 +57,6 @@ static int lowmem_minfree_size = 4;
> >  			printk(x);			\
> >  	} while (0)
> >
> > -module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
> > -module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
> > -			 S_IRUGO | S_IWUSR);
> > -module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
> > -			 S_IRUGO | S_IWUSR);
> > -module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
> > -
> >  static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
> >  {
> >  	struct task_struct *p;
> > @@ -166,6 +159,13 @@ static void __exit lowmem_exit(void)
> >  	unregister_shrinker(&lowmem_shrinker);
> >  }
> >
> > +module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
> > +module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
> > +			 S_IRUGO | S_IWUSR);
> > +module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
> > +			 S_IRUGO | S_IWUSR);
> > +module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
> > +
> >  module_init(lowmem_init);
> >  module_exit(lowmem_exit);
> 
>   isn't that a bit non-standard?  from what i've seen, the standard
> seems to be to define something as a module parameter *immediately*
> after its definition, not to collect them all at the bottom of the
> source file separate from the definitions.  *is* there a standard for
> that?

not that i know of.  and we generally prefer to avoid forward declarations
just to satisfy such errors.

---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

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

* patch staging-android-lowmemorykiller-fix-module-param-errors.patch added to gregkh-2.6 tree
  2009-07-31 18:10 [PATCH] staging/android/lowmemorykiller: fix module param errors Randy Dunlap
  2009-07-31 18:14 ` Robert P. J. Day
@ 2009-08-10 19:34 ` gregkh
  1 sibling, 0 replies; 4+ messages in thread
From: gregkh @ 2009-08-10 19:34 UTC (permalink / raw)
  To: rdunlap, gregkh, linux-kernel, randy.dunlap


This is a note to let you know that I've just added the patch titled

    Subject: Staging: android: lowmemorykiller: fix module param errors

to my gregkh-2.6 tree.  Its filename is

    staging-android-lowmemorykiller-fix-module-param-errors.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From rdunlap@xenotime.net  Mon Aug 10 11:43:15 2009
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Fri, 31 Jul 2009 11:10:45 -0700
Subject: Staging: android: lowmemorykiller: fix module param errors
To: lkml <linux-kernel@vger.kernel.org>
Cc: devel@driverdev.osuosl.org, gregkh@suse.de
Message-ID: <20090731111045.8dfd1ea5.rdunlap@xenotime.net>


From: Randy Dunlap <randy.dunlap@oracle.com>

Move module_params to near the end of the source file so that
their references are already known/defined.  Fixes build errors:

drivers/staging/android/lowmemorykiller.c: In function '__check_cost':
drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared (first use in this function)
drivers/staging/android/lowmemorykiller.c: At top level:
drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared here (not in a function)
drivers/staging/android/lowmemorykiller.c:60: warning: type defaults to 'int' in declaration of 'type name'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/android/lowmemorykiller.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -57,13 +57,6 @@ static int lowmem_minfree_size = 4;
 			printk(x);			\
 	} while (0)
 
-module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
-module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
-			 S_IRUGO | S_IWUSR);
-module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
-			 S_IRUGO | S_IWUSR);
-module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
-
 static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
 {
 	struct task_struct *p;
@@ -166,6 +159,13 @@ static void __exit lowmem_exit(void)
 	unregister_shrinker(&lowmem_shrinker);
 }
 
+module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
+module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
+			 S_IRUGO | S_IWUSR);
+module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
+			 S_IRUGO | S_IWUSR);
+module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
+
 module_init(lowmem_init);
 module_exit(lowmem_exit);
 


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

end of thread, other threads:[~2009-08-10 19:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-31 18:10 [PATCH] staging/android/lowmemorykiller: fix module param errors Randy Dunlap
2009-07-31 18:14 ` Robert P. J. Day
2009-07-31 18:22   ` Randy Dunlap
2009-08-10 19:34 ` patch staging-android-lowmemorykiller-fix-module-param-errors.patch added to gregkh-2.6 tree gregkh

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