diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-01-06 03:18:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:46 -0500 |
commit | 9010772cdff36072dd509ec72c1a55fccde8e58e (patch) | |
tree | b87fbf28462462b691b6f2bca382dd6188ef3dc1 /arch | |
parent | d571cd18f225542460b5d9b83e5e0d507be71656 (diff) |
[PATCH] uml: Add static initializations and declarations
Some structure fields were being dynamically initialized when they could be
initialized at compile-time instead. This also makes some declarations static
(in the C sense).
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/line.c | 7 | ||||
-rw-r--r-- | arch/um/drivers/mconsole_kern.c | 6 | ||||
-rw-r--r-- | arch/um/drivers/net_kern.c | 4 | ||||
-rw-r--r-- | arch/um/include/line.h | 2 |
4 files changed, 9 insertions, 10 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 9af55ece198d..1c2cc5d48bbb 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -668,19 +668,18 @@ struct tty_driver *line_register_devfs(struct lines *set, | |||
668 | return driver; | 668 | return driver; |
669 | } | 669 | } |
670 | 670 | ||
671 | static spinlock_t winch_handler_lock; | 671 | static DEFINE_SPINLOCK(winch_handler_lock); |
672 | LIST_HEAD(winch_handlers); | 672 | static LIST_HEAD(winch_handlers); |
673 | 673 | ||
674 | void lines_init(struct line *lines, int nlines) | 674 | void lines_init(struct line *lines, int nlines) |
675 | { | 675 | { |
676 | struct line *line; | 676 | struct line *line; |
677 | int i; | 677 | int i; |
678 | 678 | ||
679 | spin_lock_init(&winch_handler_lock); | ||
680 | for(i = 0; i < nlines; i++){ | 679 | for(i = 0; i < nlines; i++){ |
681 | line = &lines[i]; | 680 | line = &lines[i]; |
682 | INIT_LIST_HEAD(&line->chan_list); | 681 | INIT_LIST_HEAD(&line->chan_list); |
683 | spin_lock_init(&line->lock); | 682 | |
684 | if(line->init_str == NULL) | 683 | if(line->init_str == NULL) |
685 | continue; | 684 | continue; |
686 | 685 | ||
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 355866af5e0b..b5217bd7bc41 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
@@ -51,7 +51,7 @@ static struct notifier_block reboot_notifier = { | |||
51 | * itself and it can only happen on CPU 0. | 51 | * itself and it can only happen on CPU 0. |
52 | */ | 52 | */ |
53 | 53 | ||
54 | LIST_HEAD(mc_requests); | 54 | static LIST_HEAD(mc_requests); |
55 | 55 | ||
56 | static void mc_work_proc(void *unused) | 56 | static void mc_work_proc(void *unused) |
57 | { | 57 | { |
@@ -69,7 +69,7 @@ static void mc_work_proc(void *unused) | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | DECLARE_WORK(mconsole_work, mc_work_proc, NULL); | 72 | static DECLARE_WORK(mconsole_work, mc_work_proc, NULL); |
73 | 73 | ||
74 | static irqreturn_t mconsole_interrupt(int irq, void *dev_id, | 74 | static irqreturn_t mconsole_interrupt(int irq, void *dev_id, |
75 | struct pt_regs *regs) | 75 | struct pt_regs *regs) |
@@ -535,7 +535,7 @@ void mconsole_stack(struct mc_request *req) | |||
535 | */ | 535 | */ |
536 | static char *notify_socket = NULL; | 536 | static char *notify_socket = NULL; |
537 | 537 | ||
538 | int mconsole_init(void) | 538 | static int mconsole_init(void) |
539 | { | 539 | { |
540 | /* long to avoid size mismatch warnings from gcc */ | 540 | /* long to avoid size mismatch warnings from gcc */ |
541 | long sock; | 541 | long sock; |
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 29785f643021..deb24828e6a5 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #define DRIVER_NAME "uml-netdev" | 34 | #define DRIVER_NAME "uml-netdev" |
35 | 35 | ||
36 | static DEFINE_SPINLOCK(opened_lock); | 36 | static DEFINE_SPINLOCK(opened_lock); |
37 | LIST_HEAD(opened); | 37 | static LIST_HEAD(opened); |
38 | 38 | ||
39 | static int uml_net_rx(struct net_device *dev) | 39 | static int uml_net_rx(struct net_device *dev) |
40 | { | 40 | { |
@@ -266,7 +266,7 @@ void uml_net_user_timer_expire(unsigned long _conn) | |||
266 | } | 266 | } |
267 | 267 | ||
268 | static DEFINE_SPINLOCK(devices_lock); | 268 | static DEFINE_SPINLOCK(devices_lock); |
269 | static struct list_head devices = LIST_HEAD_INIT(devices); | 269 | static LIST_HEAD(devices); |
270 | 270 | ||
271 | static struct platform_driver uml_net_driver = { | 271 | static struct platform_driver uml_net_driver = { |
272 | .driver = { | 272 | .driver = { |
diff --git a/arch/um/include/line.h b/arch/um/include/line.h index e22c9e0f2d02..351d3ac30b78 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h | |||
@@ -58,8 +58,8 @@ struct line { | |||
58 | #define LINE_INIT(str, d) \ | 58 | #define LINE_INIT(str, d) \ |
59 | { init_str : str, \ | 59 | { init_str : str, \ |
60 | init_pri : INIT_STATIC, \ | 60 | init_pri : INIT_STATIC, \ |
61 | chan_list : { }, \ | ||
62 | valid : 1, \ | 61 | valid : 1, \ |
62 | lock : SPIN_LOCK_UNLOCKED, \ | ||
63 | buffer : NULL, \ | 63 | buffer : NULL, \ |
64 | head : NULL, \ | 64 | head : NULL, \ |
65 | tail : NULL, \ | 65 | tail : NULL, \ |