diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-01-06 03:18:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:45 -0500 |
commit | 0834cc77af6a8a650f803d4a7c3c0f134b366f87 (patch) | |
tree | a23d3746dfed759b28c250a7b5365e035a0a6542 /arch/um/drivers/ssl.c | |
parent | d50084a2991f3d9490d5c0f3af72e6fe1515a493 (diff) |
[PATCH] uml: use ARRAY_SIZE
This patch replaces instances of "sizeof(foo)/sizeof(foo[0])" with
ARRAY_SIZE(foo), which expands to the same thing.
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/um/drivers/ssl.c')
-rw-r--r-- | arch/um/drivers/ssl.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 95a3eaa7163c..8564784cd2e1 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c | |||
@@ -84,21 +84,18 @@ static struct lines lines = LINES_INIT(NR_PORTS); | |||
84 | 84 | ||
85 | static int ssl_config(char *str) | 85 | static int ssl_config(char *str) |
86 | { | 86 | { |
87 | return line_config(serial_lines, | 87 | return line_config(serial_lines, ARRAY_SIZE(serial_lines), str); |
88 | sizeof(serial_lines)/sizeof(serial_lines[0]), str); | ||
89 | } | 88 | } |
90 | 89 | ||
91 | static int ssl_get_config(char *dev, char *str, int size, char **error_out) | 90 | static int ssl_get_config(char *dev, char *str, int size, char **error_out) |
92 | { | 91 | { |
93 | return line_get_config(dev, serial_lines, | 92 | return line_get_config(dev, serial_lines, ARRAY_SIZE(serial_lines), str, |
94 | sizeof(serial_lines)/sizeof(serial_lines[0]), | 93 | size, error_out); |
95 | str, size, error_out); | ||
96 | } | 94 | } |
97 | 95 | ||
98 | static int ssl_remove(int n) | 96 | static int ssl_remove(int n) |
99 | { | 97 | { |
100 | return line_remove(serial_lines, | 98 | return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n); |
101 | sizeof(serial_lines)/sizeof(serial_lines[0]), n); | ||
102 | } | 99 | } |
103 | 100 | ||
104 | int ssl_open(struct tty_struct *tty, struct file *filp) | 101 | int ssl_open(struct tty_struct *tty, struct file *filp) |
@@ -205,7 +202,7 @@ int ssl_init(void) | |||
205 | serial_lines, | 202 | serial_lines, |
206 | ARRAY_SIZE(serial_lines)); | 203 | ARRAY_SIZE(serial_lines)); |
207 | 204 | ||
208 | lines_init(serial_lines, sizeof(serial_lines)/sizeof(serial_lines[0])); | 205 | lines_init(serial_lines, ARRAY_SIZE(serial_lines)); |
209 | 206 | ||
210 | new_title = add_xterm_umid(opts.xterm_title); | 207 | new_title = add_xterm_umid(opts.xterm_title); |
211 | if (new_title != NULL) | 208 | if (new_title != NULL) |
@@ -221,16 +218,13 @@ static void ssl_exit(void) | |||
221 | { | 218 | { |
222 | if (!ssl_init_done) | 219 | if (!ssl_init_done) |
223 | return; | 220 | return; |
224 | close_lines(serial_lines, | 221 | close_lines(serial_lines, ARRAY_SIZE(serial_lines)); |
225 | sizeof(serial_lines)/sizeof(serial_lines[0])); | ||
226 | } | 222 | } |
227 | __uml_exitcall(ssl_exit); | 223 | __uml_exitcall(ssl_exit); |
228 | 224 | ||
229 | static int ssl_chan_setup(char *str) | 225 | static int ssl_chan_setup(char *str) |
230 | { | 226 | { |
231 | return line_setup(serial_lines, | 227 | return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str, 1); |
232 | sizeof(serial_lines)/sizeof(serial_lines[0]), | ||
233 | str, 1); | ||
234 | } | 228 | } |
235 | 229 | ||
236 | __setup("ssl", ssl_chan_setup); | 230 | __setup("ssl", ssl_chan_setup); |