public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: rr tree build warnings
@ 2009-11-09  7:31 Stephen Rothwell
  2009-11-09  7:40 ` Stephen Rothwell
  2009-11-10  2:20 ` Rusty Russell
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-11-09  7:31 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel

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

Hi Rusty,

Today's linux-next build (x86_64 allmodconfig) produced these warnings:

drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'

Introduced by commit 9f94999724555729819ea0143eab1d0529c029d1
("param:param_ops").
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

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

* Re: linux-next: rr tree build warnings
  2009-11-09  7:31 linux-next: rr tree build warnings Stephen Rothwell
@ 2009-11-09  7:40 ` Stephen Rothwell
  2009-11-10  2:20   ` Rusty Russell
  2009-11-10  2:20 ` Rusty Russell
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2009-11-09  7:40 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel

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

Hi Rusty,

On Mon, 9 Nov 2009 18:31:04 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next build (x86_64 allmodconfig) produced these warnings:
> 
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> 
> Introduced by commit 9f94999724555729819ea0143eab1d0529c029d1
> ("param:param_ops").

I am also getting some section mismatch warnings like this:

WARNING: drivers/mtd/ubi/ubi.o(.data+0x1c0): Section mismatch in reference from the variable __ops_mtd to the function .init.text:ubi_mtd_param_parse()
The variable __ops_mtd references
the function __init ubi_mtd_param_parse()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

Which are probably also related to the above change.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

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

* Re: linux-next: rr tree build warnings
  2009-11-09  7:31 linux-next: rr tree build warnings Stephen Rothwell
  2009-11-09  7:40 ` Stephen Rothwell
@ 2009-11-10  2:20 ` Rusty Russell
  1 sibling, 0 replies; 5+ messages in thread
From: Rusty Russell @ 2009-11-10  2:20 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

On Mon, 9 Nov 2009 06:01:04 pm Stephen Rothwell wrote:
> Hi Rusty,
> 
> Today's linux-next build (x86_64 allmodconfig) produced these warnings:
> 
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> drivers/usb/storage/libusual.c:239: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> 
> Introduced by commit 9f94999724555729819ea0143eab1d0529c029d1
> ("param:param_ops").

Thanks Stephen!  Overzealous conversion; harmless but annoying.

I've fixed this properly now...
Rusty.

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

* Re: linux-next: rr tree build warnings
  2009-11-09  7:40 ` Stephen Rothwell
@ 2009-11-10  2:20   ` Rusty Russell
  2009-11-10  5:20     ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2009-11-10  2:20 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Sam Ravnborg

On Mon, 9 Nov 2009 06:10:46 pm Stephen Rothwell wrote:
> I am also getting some section mismatch warnings like this:
> 
> WARNING: drivers/mtd/ubi/ubi.o(.data+0x1c0): Section mismatch in reference from the variable __ops_mtd to the function .init.text:ubi_mtd_param_parse()
> The variable __ops_mtd references
> the function __init ubi_mtd_param_parse()

Right.  This needs a new rule in modpost; here's what I've added:

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -97,10 +97,10 @@ struct kparam_array
 
 /* Obsolete - use module_param_cb() */
 #define module_param_call(name, set, get, arg, perm)			\
-	static struct kernel_param_ops __ops_##name =			\
+	static struct kernel_param_ops __param_ops_##name =		\
 		 { (void *)set, (void *)get };				\
 	__module_param_call(MODULE_PARAM_PREFIX,			\
-			    name, &__ops_##name, arg,			\
+			    name, &__param_ops_##name, arg,		\
 			    __same_type(*(arg), bool),			\
 			    (perm) + sizeof(__check_old_set_param(set))*0)
 
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -951,6 +951,13 @@ static int section_mismatch(const char *
  *   fromsec = .data*
  *   atsym   =__param*
  *
+ * Pattern 1a:
+ *   module_param_call() ops can refer to __init set function if permissions=0
+ *   The pattern is identified by:
+ *   tosec   = .init.text
+ *   fromsec = .data*
+ *   atsym   = __param_ops_*
+ *
  * Pattern 2:
  *   Many drivers utilise a *driver container with references to
  *   add, remove, probe functions etc.
@@ -984,6 +991,12 @@ static int secref_whitelist(const char *
 	    (strncmp(fromsym, "__param", strlen("__param")) == 0))
 		return 0;
 
+	/* Check for pattern 1a */
+	if (strcmp(tosec, ".init.text") == 0 &&
+	    match(fromsec, data_sections) &&
+	    (strncmp(fromsym, "__param_ops_", strlen("__param_ops_")) == 0))
+		return 0;
+
 	/* Check for pattern 2 */
 	if (match(tosec, init_exit_sections) &&
 	    match(fromsec, data_sections) &&



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

* Re: linux-next: rr tree build warnings
  2009-11-10  2:20   ` Rusty Russell
@ 2009-11-10  5:20     ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2009-11-10  5:20 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Stephen Rothwell, linux-next, linux-kernel

On Tue, Nov 10, 2009 at 12:50:58PM +1030, Rusty Russell wrote:
> On Mon, 9 Nov 2009 06:10:46 pm Stephen Rothwell wrote:
> > I am also getting some section mismatch warnings like this:
> > 
> > WARNING: drivers/mtd/ubi/ubi.o(.data+0x1c0): Section mismatch in reference from the variable __ops_mtd to the function .init.text:ubi_mtd_param_parse()
> > The variable __ops_mtd references
> > the function __init ubi_mtd_param_parse()
> 
> Right.  This needs a new rule in modpost; here's what I've added:

Looks fine.

Acked-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

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

end of thread, other threads:[~2009-11-10  5:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09  7:31 linux-next: rr tree build warnings Stephen Rothwell
2009-11-09  7:40 ` Stephen Rothwell
2009-11-10  2:20   ` Rusty Russell
2009-11-10  5:20     ` Sam Ravnborg
2009-11-10  2:20 ` Rusty Russell

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