linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix for MODULE_PARM obsolete
@ 2004-10-21  5:25 Rusty Russell
  2004-10-21  5:26 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2004-10-21  5:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml - Kernel Mailing List

Name: Fix MODULE_PARM warning
Status: Trivial
Depends: Module/MODULE_PARM-warning.patch.gz
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

There is no __attribute_unused__: use __attribute__((__unused__)).

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .16175-linux-2.6-bk/include/linux/module.h .16175-linux-2.6-bk.updated/include/linux/module.h
--- .16175-linux-2.6-bk/include/linux/module.h	2004-10-21 14:29:08.000000000 +1000
+++ .16175-linux-2.6-bk.updated/include/linux/module.h	2004-10-21 14:31:38.000000000 +1000
@@ -570,7 +570,7 @@ extern void __deprecated MODULE_PARM_(vo
 struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
 { __stringify(var), type, &MODULE_PARM_ };
 #else
-#define MODULE_PARM(var,type) static void __attribute_unused__ *__parm_##var = &MODULE_PARM_;
+#define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_;
 #endif
 
 #define __MODULE_STRING(x) __stringify(x)

-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


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

* Re: Fix for MODULE_PARM obsolete
  2004-10-21  5:25 Fix for MODULE_PARM obsolete Rusty Russell
@ 2004-10-21  5:26 ` Andrew Morton
  2004-10-21  5:55   ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2004-10-21  5:26 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> There is no __attribute_unused__: use __attribute__((__unused__)).

Will that fix this?

/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to `MODULE_PARM_'
drivers/built-in.o(.data+0x35dcc):/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to `MODULE_PARM_'
drivers/built-in.o(.data+0x35dd0):/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to `MODULE_PARM_'
drivers/built-in.o(.data+0x35dd4):/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to `MODULE_PARM_'
make: *** [.tmp_vmlinux1] Error 1


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

* Re: Fix for MODULE_PARM obsolete
  2004-10-21  5:26 ` Andrew Morton
@ 2004-10-21  5:55   ` Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2004-10-21  5:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml - Kernel Mailing List

On Thu, 2004-10-21 at 15:26, Andrew Morton wrote:
> Rusty Russell <rusty@rustcorp.com.au> wrote:
> >
> > There is no __attribute_unused__: use __attribute__((__unused__)).
> 
> Will that fix this?
> 
> /usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to `MODULE_PARM_'

No, but this will.  Tested on a tree which still has MODULE_PARM in it.

Name: Fixe MODULE_PARM warning
Status: Tested on 2.6-bk
Depends: Module/MODULE_PARM-warning.patch.gz
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

There is no __attribute_unused__: use __attribute__((__unused__)).
Also, needs a real MODULE_PARM_ for when gcc doesn't throw it away for us.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .20741-linux-2.6-bk/include/linux/module.h .20741-linux-2.6-bk.updated/include/linux/module.h
--- .20741-linux-2.6-bk/include/linux/module.h	2004-10-21 15:46:41.000000000 +1000
+++ .20741-linux-2.6-bk.updated/include/linux/module.h	2004-10-21 15:46:45.000000000 +1000
@@ -563,14 +563,14 @@ struct obsolete_modparm {
 	void *addr;
 };
 
-extern void __deprecated MODULE_PARM_(void);
+static inline void __deprecated MODULE_PARM_(void) { }
 #ifdef MODULE
 /* DEPRECATED: Do not use. */
 #define MODULE_PARM(var,type)						    \
 struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
 { __stringify(var), type, &MODULE_PARM_ };
 #else
-#define MODULE_PARM(var,type) static void __attribute_unused__ *__parm_##var = &MODULE_PARM_;
+#define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_;
 #endif
 
 #define __MODULE_STRING(x) __stringify(x)

-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


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

end of thread, other threads:[~2004-10-21  5:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-21  5:25 Fix for MODULE_PARM obsolete Rusty Russell
2004-10-21  5:26 ` Andrew Morton
2004-10-21  5:55   ` Rusty Russell

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