From: Christoph Hellwig <hch@lst.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Christoph Hellwig <hch@lst.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] move some more intilization out of drivers/char/mem.c
Date: Sun, 21 Sep 2003 08:30:30 +0200 [thread overview]
Message-ID: <20030921063030.GA1508@lst.de> (raw)
In-Reply-To: <20030920160645.30c2745d.akpm@osdl.org>
On Sat, Sep 20, 2003 at 04:06:45PM -0700, Andrew Morton wrote:
> drivers/char/tty_io.c:2516: warning: initialization from incompatible pointer type
> drivers/char/misc.c:281: warning: static declaration for `misc_init' follows non-static
>
> Please compile-test things...
Well, I compiled this here. I see, looks like I lost half of the patch
when sending it to you. Sorryh for that, here's the full patch:
--- 1.58/drivers/char/Makefile Sat Jun 7 15:41:09 2003
+++ edited/drivers/char/Makefile Sat Sep 20 13:13:49 2003
@@ -7,7 +7,7 @@
#
FONTMAPFILE = cp437.uni
-obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
+obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o
obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
--- 1.43/drivers/char/mem.c Tue Aug 26 18:25:41 2003
+++ edited/drivers/char/mem.c Sat Sep 20 13:12:30 2003
@@ -680,17 +680,8 @@
S_IFCHR | devlist[i].mode, devlist[i].name);
}
- rand_initialize();
#if defined (CONFIG_FB)
fbmem_init();
-#endif
- tty_init();
-#ifdef CONFIG_M68K_PRINTER
- lp_m68k_init();
-#endif
- misc_init();
-#ifdef CONFIG_FTAPE
- ftape_init();
#endif
return 0;
}
--- 1.23/drivers/char/misc.c Wed Sep 17 15:42:51 2003
+++ edited/drivers/char/misc.c Sat Sep 20 13:12:30 2003
@@ -277,7 +277,7 @@
EXPORT_SYMBOL(misc_register);
EXPORT_SYMBOL(misc_deregister);
-int __init misc_init(void)
+static int __init misc_init(void)
{
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *ent;
@@ -320,3 +320,4 @@
}
return 0;
}
+module_init(misc_init);
--- 1.38/drivers/char/random.c Wed Sep 10 08:41:47 2003
+++ edited/drivers/char/random.c Sat Sep 20 13:12:30 2003
@@ -1493,7 +1493,7 @@
}
}
-void __init rand_initialize(void)
+static void __init rand_initialize(void)
{
int i;
@@ -1516,6 +1516,7 @@
memset(&extract_timer_state, 0, sizeof(struct timer_rand_state));
extract_timer_state.dont_count_entropy = 1;
}
+module_init(rand_initialize);
void rand_initialize_irq(int irq)
{
--- 1.119/drivers/char/tty_io.c Fri Sep 5 13:31:50 2003
+++ edited/drivers/char/tty_io.c Sat Sep 20 13:12:30 2003
@@ -2423,7 +2423,7 @@
* Ok, now we can initialize the rest of the tty devices and can count
* on memory allocations, interrupts etc..
*/
-void __init tty_init(void)
+static void __init tty_init(void)
{
strcpy(tty_cdev.kobj.name, "dev.tty");
cdev_init(&tty_cdev, &tty_fops);
@@ -2513,3 +2513,4 @@
a2232board_init();
#endif
}
+module_init(tty_init);
--- 1.4/drivers/char/ftape/lowlevel/ftape-init.c Mon Feb 3 21:19:37 2003
+++ edited/drivers/char/ftape/lowlevel/ftape-init.c Sun Sep 21 08:22:04 2003
@@ -55,14 +55,24 @@
char ft_dat[] __initdata = "$Date: 1997/11/06 00:38:08 $";
+#ifndef CONFIG_FT_NO_TRACE_AT_ALL
+static int ft_tracing = -1;
+#endif
+
+
/* Called by modules package when installing the driver
* or by kernel during the initialization phase
*/
-int __init ftape_init(void)
+static int __init ftape_init(void)
{
TRACE_FUN(ft_t_flow);
#ifdef MODULE
+#ifndef CONFIG_FT_NO_TRACE_AT_ALL
+ if (ft_tracing != -1) {
+ ftape_tracing = ft_tracing;
+ }
+#endif
printk(KERN_INFO FTAPE_VERSION "\n");
if (TRACE_LEVEL >= ft_t_info) {
printk(
@@ -112,13 +122,6 @@
#endif
TRACE_EXIT 0;
}
-
-#ifdef MODULE
-
-#ifndef CONFIG_FT_NO_TRACE_AT_ALL
-static int ft_tracing = -1;
-#endif
-
#define FT_MOD_PARM(var,type,desc) \
MODULE_PARM(var,type); MODULE_PARM_DESC(var,desc)
@@ -141,21 +144,7 @@
"QIC-117 driver for QIC-40/80/3010/3020 floppy tape drives.");
MODULE_LICENSE("GPL");
-/* Called by modules package when installing the driver
- */
-int init_module(void)
-{
-#ifndef CONFIG_FT_NO_TRACE_AT_ALL
- if (ft_tracing != -1) {
- ftape_tracing = ft_tracing;
- }
-#endif
- return ftape_init();
-}
-
-/* Called by modules package when removing the driver
- */
-void cleanup_module(void)
+static void __exit ftape_exit(void)
{
TRACE_FUN(ft_t_flow);
@@ -166,4 +155,6 @@
printk(KERN_INFO "ftape: unloaded.\n");
TRACE_EXIT;
}
-#endif /* MODULE */
+
+module_init(ftape_init);
+module_exit(ftape_exit);
--- 1.3/include/linux/ftape.h Tue Apr 1 01:55:26 2003
+++ edited/include/linux/ftape.h Sat Sep 20 13:12:31 2003
@@ -199,8 +199,6 @@
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define NR_ITEMS(x) (int)(sizeof(x)/ sizeof(*x))
-extern int ftape_init(void);
-
#endif /* __KERNEL__ */
#endif
--- 1.9/include/linux/miscdevice.h Wed Sep 17 15:43:05 2003
+++ edited/include/linux/miscdevice.h Sat Sep 20 13:12:31 2003
@@ -36,8 +36,6 @@
#define TUN_MINOR 200
-extern int misc_init(void);
-
struct miscdevice
{
int minor;
--- 1.2/include/linux/random.h Mon Oct 28 20:57:55 2002
+++ edited/include/linux/random.h Sat Sep 20 13:12:31 2003
@@ -42,7 +42,6 @@
#ifdef __KERNEL__
-extern void rand_initialize(void);
extern void rand_initialize_irq(int irq);
extern void batch_entropy_store(u32 a, u32 b, int num);
--- 1.20/include/linux/tty.h Tue Aug 26 18:25:40 2003
+++ edited/include/linux/tty.h Sat Sep 20 13:12:31 2003
@@ -351,7 +351,6 @@
extern int lp_init(void);
extern int pty_init(void);
-extern void tty_init(void);
extern int mxser_init(void);
extern int moxa_init(void);
extern int ip2_init(void);
next prev parent reply other threads:[~2003-09-21 6:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-20 13:29 [PATCH] move some more intilization out of drivers/char/mem.c Christoph Hellwig
2003-09-20 23:06 ` Andrew Morton
2003-09-21 6:30 ` Christoph Hellwig [this message]
2003-09-21 6:48 ` Andrew Morton
2003-09-21 7:05 ` Christoph Hellwig
2003-09-21 17:03 ` Randy.Dunlap
2003-09-21 7:54 ` Muli Ben-Yehuda
2003-09-22 11:13 ` Adrian Bunk
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=20030921063030.GA1508@lst.de \
--to=hch@lst.de \
--cc=akpm@osdl.org \
--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.