Re: Fix for MODULE_PARM obsolete

From: Rusty Russell
Date: Thu Oct 21 2004 - 01:11:21 EST


On Thu, 2004-10-21 at 15:26, Andrew Morton wrote:
> Rusty Russell <rusty@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx>

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/