diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-02-10 04:44:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:23 -0500 |
commit | f2e62992a232544d612b7b95e932fbf3592944e1 (patch) | |
tree | 2c845c925ed522453f69d5e8c772fc9153124c2d | |
parent | f688144b827749879279c3ad272b8d874fc17231 (diff) |
[PATCH] uml: IRQ handler tidying
Tidying the irq code -
make a variable static
activate_fd can call kmalloc directly since it's now kernel code
added a no-locking comment
fixed a style violation
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/um/kernel/irq.c | 7 | ||||
-rw-r--r-- | arch/um/os-Linux/irq.c | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 5c1e611f628d..50a288bb875a 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -79,7 +79,7 @@ skip: | |||
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | struct irq_fd *active_fds = NULL; | 82 | static struct irq_fd *active_fds = NULL; |
83 | static struct irq_fd **last_irq_ptr = &active_fds; | 83 | static struct irq_fd **last_irq_ptr = &active_fds; |
84 | 84 | ||
85 | extern void free_irqs(void); | 85 | extern void free_irqs(void); |
@@ -124,8 +124,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
124 | if (err < 0) | 124 | if (err < 0) |
125 | goto out; | 125 | goto out; |
126 | 126 | ||
127 | new_fd = um_kmalloc(sizeof(*new_fd)); | ||
128 | err = -ENOMEM; | 127 | err = -ENOMEM; |
128 | new_fd = kmalloc(sizeof(struct irq_fd), GFP_KERNEL); | ||
129 | if (new_fd == NULL) | 129 | if (new_fd == NULL) |
130 | goto out; | 130 | goto out; |
131 | 131 | ||
@@ -176,9 +176,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
176 | */ | 176 | */ |
177 | spin_unlock_irqrestore(&irq_lock, flags); | 177 | spin_unlock_irqrestore(&irq_lock, flags); |
178 | kfree(tmp_pfd); | 178 | kfree(tmp_pfd); |
179 | tmp_pfd = NULL; | ||
180 | 179 | ||
181 | tmp_pfd = um_kmalloc(n); | 180 | tmp_pfd = kmalloc(n, GFP_KERNEL); |
182 | if (tmp_pfd == NULL) | 181 | if (tmp_pfd == NULL) |
183 | goto out_kfree; | 182 | goto out_kfree; |
184 | 183 | ||
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c index d46b818c1311..d1b61d474e0a 100644 --- a/arch/um/os-Linux/irq.c +++ b/arch/um/os-Linux/irq.c | |||
@@ -20,6 +20,10 @@ | |||
20 | #include "os.h" | 20 | #include "os.h" |
21 | #include "um_malloc.h" | 21 | #include "um_malloc.h" |
22 | 22 | ||
23 | /* | ||
24 | * Locked by irq_lock in arch/um/kernel/irq.c. Changed by os_create_pollfd | ||
25 | * and os_free_irq_by_cb, which are called under irq_lock. | ||
26 | */ | ||
23 | static struct pollfd *pollfds = NULL; | 27 | static struct pollfd *pollfds = NULL; |
24 | static int pollfds_num = 0; | 28 | static int pollfds_num = 0; |
25 | static int pollfds_size = 0; | 29 | static int pollfds_size = 0; |
@@ -58,7 +62,7 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) | |||
58 | if (pollfds_num == pollfds_size) { | 62 | if (pollfds_num == pollfds_size) { |
59 | if (size_tmpfds <= pollfds_size * sizeof(pollfds[0])) { | 63 | if (size_tmpfds <= pollfds_size * sizeof(pollfds[0])) { |
60 | /* return min size needed for new pollfds area */ | 64 | /* return min size needed for new pollfds area */ |
61 | return((pollfds_size + 1) * sizeof(pollfds[0])); | 65 | return (pollfds_size + 1) * sizeof(pollfds[0]); |
62 | } | 66 | } |
63 | 67 | ||
64 | if (pollfds != NULL) { | 68 | if (pollfds != NULL) { |