move some more intilization out of drivers/char/mem.c
Subsystems (5)
PATCH 1/1 move some more intilization out of drivers/char/mem.c
keeping init order the same..
drivers/char/Makefile +1 -1
@@ -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
drivers/char/mem.c +0 -9
@@ -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 ; }
drivers/char/misc.c +2 -1
@@ -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);
drivers/char/random.c +2 -1
@@ -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) {
drivers/char/tty_io.c +2 -1
@@ -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);
drivers/char/ftape/lowlevel/ftape-init.c +15 -23
@@ -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);
@@ -167,3 +156,6 @@ TRACE_EXIT; }#endif /* MODULE */ + +module_init (ftape_init); +module_exit (ftape_exit);
Quoted 2 lines · Christoph Hellwig
keeping init order the same..
drivers/char/random.c:1497: warning: static declaration for rand_initialize' follows non-static drivers/char/random.c:1519: warning: initialization from incompatible pointer type drivers/char/tty_io.c:2427: warning: static declaration for tty_init' follows non-static 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...
Quoted 4 lines · Andrew Morton
drivers/char/tty_io.c:2516: warning: initialization from incompatible pointer typedrivers/char/misc.c:281: warning: static declaration for `misc_init' follows non-staticPlease 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:
drivers/char/Makefile +1 -1
@@ -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
drivers/char/mem.c +0 -9
@@ -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 ; }
drivers/char/misc.c +2 -1
@@ -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);
drivers/char/random.c +2 -1
@@ -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) {
drivers/char/tty_io.c +2 -1
@@ -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);
drivers/char/ftape/lowlevel/ftape-init.c +15 -24
@@ -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);
include/linux/ftape.h +0 -2
@@ -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
include/linux/miscdevice.h +0 -2
@@ -36,8 +36,6 @@#define TUN_MINOR 200 -extern int misc_init (void ); -struct miscdevice {int minor;
include/linux/random.h +0 -1
@@ -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);
include/linux/tty.h +0 -1
@@ -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 );
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines
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:
It still generates warnings. I suggest you build kernels with a script which saves up stderr and spits it all out at the end. That way, these things are noticed.
drivers/char/random.c | 3 ++- drivers/char/tty_io.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/char/random.c renamed from drivers/char/random.c~char-init-cleanup-fix +2 -1
@@ -1493,7 +1493,7 @@ static void init_std_data(struct entropy } } -static void __init rand_initialize (void ) +static int __init rand_initialize (void ) {int i;
@@ -1515,6 +1515,7 @@ static void __init rand_initialize(void)memset (&mouse_timer_state,0 ,sizeof (struct timer_rand_state ));memset (&extract_timer_state,0 ,sizeof (struct timer_rand_state )); extract_timer_state.dont_count_entropy =1 ; +return 0 ; }module_init (rand_initialize);
drivers/char/tty_io.c renamed from drivers/char/tty_io.c~char-init-cleanup-fix +2 -1
@@ -2423,7 +2423,7 @@ static struct cdev vc0_cdev;* Ok, now we can initialize the rest of the tty devices and can count * on memory allocations, interrupts etc.. */ -static void __init tty_init (void ) +static int __init tty_init (void ) {strcpy (tty_cdev.kobj.name,"dev.tty" );cdev_init (&tty_cdev, &tty_fops);
@@ -2512,5 +2512,6 @@ static void __init tty_init(void)#ifdef CONFIG_A2232 a2232board_init ();#endif +return 0 ; }module_init (tty_init);
_
Quoted 10 lines · Andrew Morton
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines
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:
It still generates warnings. I suggest you build kernels with a script which saves up stderr and spits it all out at the end. That way, these things are noticed.
Well, I do that, but they slipped through anyway. I did a completle rebuild now and saw them. I really need a filter for all those anoying warnings from the debian sid assembler..
On Sun, 21 Sep 2003 09:05:24 +0200 Christoph Hellwig <[email protected]> wrote:
| On Sat, Sep 20, 2003 at 11:48:53PM -0700, Andrew Morton wrote: | > Christoph Hellwig <[email protected]> wrote: | > > | > > > 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: | > | > It still generates warnings. I suggest you build kernels with a script | > which saves up stderr and spits it all out at the end. That way, these | > things are noticed. | | Well, I do that, but they slipped through anyway. I did a completle | rebuild now and saw them. I really need a filter for all those anoying | warnings from the debian sid assembler..
I don't know what the assembler messages are, but I often do this:
make -j4 bzImage modules > buildk.out 2>&1
bldlogstrip buildk.out > buildkk.out
where 'bldlogstrip' is:
#! /bin/sh
# strip lines that contain CC, LD, "standard input", "In function" egrep -v "CC|LD" $1 | grep -v "standard input" | grep -v "In function"
to get down to messages to focus on.
--
~Randy
Quoted 10 lines · Andrew Morton
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines
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:
It still generates warnings. I suggest you build kernels with a script which saves up stderr and spits it all out at the end. That way, these things are noticed.
This might be a good time to recommend -Werror. Last time it came up
(http://marc.theaimsgroup.com/?l=linux-kernel&m=102654562025374&w=2),
Alan was dead set against it, and Linus did not apply it, but did think it had some merit
(http://marc.theaimsgroup.com/?l=linux-kernel&m=102658611213914&w=2).
Compiling 2.6.0-t5-cvs with my .config and -Werror uncovered only two warnings. Patches sent seperately.
Makefile renamed from linux-2.5/Makefile +3 -3
@@ -73,7 +73,7 @@ HOSTCC = gcc HOSTCXX = g++ -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer HOSTCXXFLAGS = -O2
@@ -223,8 +223,8 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include CPPFLAGS := -D__KERNEL__ -Iinclude -CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ - -fno-strict-aliasing -fno-common +CFLAGS := -Wall -Werror -Wstrict-prototypes -Wno-trigraphs \ + -O2 -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org
Quoted 18 lines · Muli Ben-Yehuda
Quoted 10 lines · Andrew Morton
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines
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:
It still generates warnings. I suggest you build kernels with a script which saves up stderr and spits it all out at the end. That way, these things are noticed.
This might be a good time to recommend -Werror. Last time it came up
(http://marc.theaimsgroup.com/?l=linux-kernel&m=102654562025374&w=2),
Alan was dead set against it, and Linus did not apply it, but did think it had some merit
(http://marc.theaimsgroup.com/?l=linux-kernel&m=102658611213914&w=2).
Quoted 3 lines
Compiling 2.6.0-t5-cvs with my .config and -Werror uncovered only two warnings. Patches sent seperately.
...
In 2.6, warnings are very visible, and many people are working on reducing the number of warning.
A full build of 2.6 gives between 200 and 300 warnings with gcc 3.3 including harmless ones.
You get several "unused variable" warnings when you disable e.g. CONFIG_PROC_FS.
When compiling with a different compiler version (e.g. 2.95) you get a similar number of warnings, but different warnings.
Some warnings are the fault of gcc (and noone will fix gcc 2.95 or the unofficial gcc 2.96).
Adding -Werror will turn into a maintenance nightmare.
Quoted 1 line
Muli Ben-Yehuda
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed