From: Ben Dooks <ben@fluff.org.uk>
To: Arthur Othieno <a.othieno@bluewin.ch>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] - create common header for init/main.c called init functions
Date: Wed, 19 Oct 2005 20:50:55 +0100 [thread overview]
Message-ID: <20051019195055.GC32720@home.fluff.org> (raw)
In-Reply-To: <20051018231109.GA15443@krypton>
[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]
On Tue, Oct 18, 2005 at 07:11:09PM -0400, Arthur Othieno wrote:
> On Fri, Oct 14, 2005 at 01:42:10AM +0100, Ben Dooks wrote:
> > init/main.c calls a number of functions externally
> > but declaring them locally. This patch creates a
> > new header (linux/kernel_init.h) and moves all
> > the declarations into it.
>
> These functions are only referenced in init/main.c, and rightfully so.
> In the end, this doesn't change anything much, other than maintainance
> overhead for the new include/linux/kernel_init.h
>
> But, comments within..
>
> > Also removes any old init functions now done by
> > an initcall()
>
> (mca|sbus|tc)_init() removal look good.
>
> > Signed-off-by: Ben Dooks <ben-linux@fluff.org>
>
> > diff -urpN -X ../dontdiff linux-2.6.14-rc4-bjd3b/drivers/acpi/bus.c linux-2.6.14-rc4-bjd3c/drivers/acpi/bus.c
> > --- linux-2.6.14-rc4-bjd3b/drivers/acpi/bus.c 2005-10-11 10:56:31.000000000 +0100
> > +++ linux-2.6.14-rc4-bjd3c/drivers/acpi/bus.c 2005-10-14 01:32:27.000000000 +0100
> > @@ -30,6 +30,7 @@
> > #include <linux/pm.h>
> > #include <linux/device.h>
> > #include <linux/proc_fs.h>
> > +#include <linux/kernel_init.h>
I've attached a pair of patches, the first removes
the unused functions, and the second moves the init
function declarations into include/linux/init.h
(and adds the init to include/linux/prio_tree.h)
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
[-- Attachment #2: init-remove-unused.patch --]
[-- Type: text/plain, Size: 791 bytes --]
diff -urp -X linux-2.6.14-rc4-git7-bjd1/Documentation/dontdiff linux-2.6.14-rc4-git7/init/main.c linux-2.6.14-rc4-git7-bjd1/init/main.c
--- linux-2.6.14-rc4-git7/init/main.c 2005-10-19 12:44:36.000000000 +0100
+++ linux-2.6.14-rc4-git7-bjd1/init/main.c 2005-10-19 12:51:19.000000000 +0100
@@ -82,8 +82,6 @@ static int init(void *);
extern void init_IRQ(void);
extern void fork_init(unsigned long);
-extern void mca_init(void);
-extern void sbus_init(void);
extern void sysctl_init(void);
extern void signals_init(void);
extern void buffer_init(void);
@@ -101,10 +99,6 @@ extern void acpi_early_init(void);
static inline void acpi_early_init(void) { }
#endif
-#ifdef CONFIG_TC
-extern void tc_init(void);
-#endif
-
enum system_states system_state;
EXPORT_SYMBOL(system_state);
[-- Attachment #3: init-move-delarations.patch --]
[-- Type: text/plain, Size: 2790 bytes --]
diff -urp -X linux-2.6.14-rc4-git7-bjd1/Documentation/dontdiff linux-2.6.14-rc4-git7-bjd1/include/linux/init.h linux-2.6.14-rc4-git7-bjd2/include/linux/init.h
--- linux-2.6.14-rc4-git7-bjd1/include/linux/init.h 2005-08-29 00:41:01.000000000 +0100
+++ linux-2.6.14-rc4-git7-bjd2/include/linux/init.h 2005-10-19 14:15:20.000000000 +0100
@@ -143,6 +143,25 @@ struct obs_kernel_param {
/* Relies on saved_command_line being set */
void __init parse_early_param(void);
+
+/* items used by init/main.c */
+
+extern void __init init_IRQ(void);
+extern void __init fork_init(unsigned long);
+extern void __init sysctl_init(void);
+extern void __init signals_init(void);
+extern void __init buffer_init(void);
+extern void __init pidhash_init(void);
+extern void __init pidmap_init(void);
+extern void __init free_initmem(void);
+extern void __init populate_rootfs(void);
+extern void __init driver_init(void);
+extern void __init prepare_namespace(void);
+
+#ifdef CONFIG_ACPI
+extern void __init acpi_early_init(void);
+#endif
+
#endif /* __ASSEMBLY__ */
/**
diff -urp -X linux-2.6.14-rc4-git7-bjd1/Documentation/dontdiff linux-2.6.14-rc4-git7-bjd1/include/linux/prio_tree.h linux-2.6.14-rc4-git7-bjd2/include/linux/prio_tree.h
--- linux-2.6.14-rc4-git7-bjd1/include/linux/prio_tree.h 2005-08-29 00:41:01.000000000 +0100
+++ linux-2.6.14-rc4-git7-bjd2/include/linux/prio_tree.h 2005-10-19 13:31:41.000000000 +0100
@@ -117,4 +117,6 @@ struct prio_tree_node *prio_tree_next(st
#define raw_prio_tree_remove(root, node) \
prio_tree_remove(root, (struct prio_tree_node *) (node))
+extern void __init prio_tree_init(void);
+
#endif /* _LINUX_PRIO_TREE_H */
diff -urp -X linux-2.6.14-rc4-git7-bjd1/Documentation/dontdiff linux-2.6.14-rc4-git7-bjd1/init/main.c linux-2.6.14-rc4-git7-bjd2/init/main.c
--- linux-2.6.14-rc4-git7-bjd1/init/main.c 2005-10-19 12:51:19.000000000 +0100
+++ linux-2.6.14-rc4-git7-bjd2/init/main.c 2005-10-19 14:15:26.000000000 +0100
@@ -47,6 +47,8 @@
#include <linux/rmap.h>
#include <linux/mempolicy.h>
#include <linux/key.h>
+#include <linux/prio_tree.h>
+#include <linux/radix-tree.h>
#include <net/sock.h>
#include <asm/io.h>
@@ -80,22 +82,7 @@
static int init(void *);
-extern void init_IRQ(void);
-extern void fork_init(unsigned long);
-extern void sysctl_init(void);
-extern void signals_init(void);
-extern void buffer_init(void);
-extern void pidhash_init(void);
-extern void pidmap_init(void);
-extern void prio_tree_init(void);
-extern void radix_tree_init(void);
-extern void free_initmem(void);
-extern void populate_rootfs(void);
-extern void driver_init(void);
-extern void prepare_namespace(void);
-#ifdef CONFIG_ACPI
-extern void acpi_early_init(void);
-#else
+#ifndef CONFIG_ACPI
static inline void acpi_early_init(void) { }
#endif
prev parent reply other threads:[~2005-10-19 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-14 0:42 [PATCH] - create common header for init/main.c called init functions Ben Dooks
2005-10-18 23:11 ` Arthur Othieno
2005-10-18 23:44 ` Adrian Bunk
2005-10-19 6:30 ` Ben Dooks
2005-10-19 19:50 ` Ben Dooks [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051019195055.GC32720@home.fluff.org \
--to=ben@fluff.org.uk \
--cc=a.othieno@bluewin.ch \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.