public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] In-kernel module loader 5/7
@ 2002-09-18  2:08 Rusty Russell
  2002-09-18  7:43 ` J.A. Magallon
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2002-09-18  2:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo

Name: Every module needs module_init
Author: Rusty Russell
Status: Trivial

D: Every module needs a module_init now, so insert a trivial one where
D: needed.  This is not exhaustive.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17783-2.5.35-modbase-try-i386.pre/lib/zlib_deflate/deflate_syms.c .17783-2.5.35-modbase-try-i386/lib/zlib_deflate/deflate_syms.c
--- .17783-2.5.35-modbase-try-i386.pre/lib/zlib_deflate/deflate_syms.c	2002-02-20 17:56:17.000000000 +1100
+++ .17783-2.5.35-modbase-try-i386/lib/zlib_deflate/deflate_syms.c	2002-09-18 11:45:27.000000000 +1000
@@ -19,3 +19,9 @@ EXPORT_SYMBOL(zlib_deflateReset);
 EXPORT_SYMBOL(zlib_deflateCopy);
 EXPORT_SYMBOL(zlib_deflateParams);
 MODULE_LICENSE("GPL");
+
+static int init(void)
+{
+	return 0;
+}
+module_init(init);
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17783-2.5.35-modbase-try-i386.pre/lib/zlib_inflate/inflate_syms.c .17783-2.5.35-modbase-try-i386/lib/zlib_inflate/inflate_syms.c
--- .17783-2.5.35-modbase-try-i386.pre/lib/zlib_inflate/inflate_syms.c	2002-02-20 17:56:42.000000000 +1100
+++ .17783-2.5.35-modbase-try-i386/lib/zlib_inflate/inflate_syms.c	2002-09-18 11:45:27.000000000 +1000
@@ -20,3 +20,9 @@ EXPORT_SYMBOL(zlib_inflateReset);
 EXPORT_SYMBOL(zlib_inflateSyncPoint);
 EXPORT_SYMBOL(zlib_inflateIncomp); 
 MODULE_LICENSE("GPL");
+
+static int init(void)
+{
+	return 0;
+}
+module_init(init);

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

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

* Re: [PATCH] In-kernel module loader 5/7
  2002-09-18  2:08 [PATCH] In-kernel module loader 5/7 Rusty Russell
@ 2002-09-18  7:43 ` J.A. Magallon
  2002-09-18 22:07   ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: J.A. Magallon @ 2002-09-18  7:43 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel


On 2002.09.18 Rusty Russell wrote:
>Name: Every module needs module_init
>Author: Rusty Russell
>Status: Trivial
>
>D: Every module needs a module_init now, so insert a trivial one where
>D: needed.  This is not exhaustive.
>
>diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17783-2.5.35-modbase-try-i386.pre/lib/zlib_deflate/deflate_syms.c .17783-2.5.35-modbase-try-i386/lib/zlib_deflate/deflate_syms.c
>--- .17783-2.5.35-modbase-try-i386.pre/lib/zlib_deflate/deflate_syms.c	2002-02-20 17:56:17.000000000 +1100
>+++ .17783-2.5.35-modbase-try-i386/lib/zlib_deflate/deflate_syms.c	2002-09-18 11:45:27.000000000 +1000
>@@ -19,3 +19,9 @@ EXPORT_SYMBOL(zlib_deflateReset);
> EXPORT_SYMBOL(zlib_deflateCopy);
> EXPORT_SYMBOL(zlib_deflateParams);
> MODULE_LICENSE("GPL");
>+
>+static int init(void)
>+{
>+	return 0;
>+}
>+module_init(init);

Would not be worthy to do something like

#define MODULE_INIT_DEFAULT \
static int init(void) { return o;} \
module_init(init)
...

so you just can add:

MODULE_INIT_DEFAULT;
MODULE_EXIT_DEFAULT;

-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.0 (Cooker) for i586
Linux 2.4.20-pre7-jam1 (gcc 3.2 (Mandrake Linux 9.0 3.2-1mdk))

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

* Re: [PATCH] In-kernel module loader 5/7
  2002-09-18  7:43 ` J.A. Magallon
@ 2002-09-18 22:07   ` Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2002-09-18 22:07 UTC (permalink / raw)
  To: J.A. Magallon; +Cc: linux-kernel

In message <20020918074310.GA1539@werewolf.able.es> you write:
> Would not be worthy to do something like
> 
> #define MODULE_INIT_DEFAULT \
> static int init(void) { return o;} \
> module_init(init)
> ...
> 
> so you just can add:
> 
> MODULE_INIT_DEFAULT;
> MODULE_EXIT_DEFAULT;

Hmmm... I didn't do that because I want people to *think* about init
and exit issues, and because most modules *do* need some
initialization.

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

end of thread, other threads:[~2002-09-18 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-18  2:08 [PATCH] In-kernel module loader 5/7 Rusty Russell
2002-09-18  7:43 ` J.A. Magallon
2002-09-18 22:07   ` Rusty Russell

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