summaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 00:18:51 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:45 -0800
commit0834cc77af6a8a650f803d4a7c3c0f134b366f87 (patch)
treea23d3746dfed759b28c250a7b5365e035a0a6542 /arch/um
parentd50084a2991f3d9490d5c0f3af72e6fe1515a493 (diff)
downloadop-kernel-dev-0834cc77af6a8a650f803d4a7c3c0f134b366f87.zip
op-kernel-dev-0834cc77af6a8a650f803d4a7c3c0f134b366f87.tar.gz
[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')
-rw-r--r--arch/um/drivers/ssl.c20
-rw-r--r--arch/um/drivers/stdio_console.c13
2 files changed, 13 insertions, 20 deletions
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index 95a3eaa..8564784c 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);
static int ssl_config(char *str)
{
- return line_config(serial_lines,
- sizeof(serial_lines)/sizeof(serial_lines[0]), str);
+ return line_config(serial_lines, ARRAY_SIZE(serial_lines), str);
}
static int ssl_get_config(char *dev, char *str, int size, char **error_out)
{
- return line_get_config(dev, serial_lines,
- sizeof(serial_lines)/sizeof(serial_lines[0]),
- str, size, error_out);
+ return line_get_config(dev, serial_lines, ARRAY_SIZE(serial_lines), str,
+ size, error_out);
}
static int ssl_remove(int n)
{
- return line_remove(serial_lines,
- sizeof(serial_lines)/sizeof(serial_lines[0]), n);
+ return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n);
}
int ssl_open(struct tty_struct *tty, struct file *filp)
@@ -205,7 +202,7 @@ int ssl_init(void)
serial_lines,
ARRAY_SIZE(serial_lines));
- lines_init(serial_lines, sizeof(serial_lines)/sizeof(serial_lines[0]));
+ lines_init(serial_lines, ARRAY_SIZE(serial_lines));
new_title = add_xterm_umid(opts.xterm_title);
if (new_title != NULL)
@@ -221,16 +218,13 @@ static void ssl_exit(void)
{
if (!ssl_init_done)
return;
- close_lines(serial_lines,
- sizeof(serial_lines)/sizeof(serial_lines[0]));
+ close_lines(serial_lines, ARRAY_SIZE(serial_lines));
}
__uml_exitcall(ssl_exit);
static int ssl_chan_setup(char *str)
{
- return line_setup(serial_lines,
- sizeof(serial_lines)/sizeof(serial_lines[0]),
- str, 1);
+ return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str, 1);
}
__setup("ssl", ssl_chan_setup);
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index 8f3b168..b77f7d2 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -91,18 +91,17 @@ struct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver),
static int con_config(char *str)
{
- return line_config(vts, sizeof(vts)/sizeof(vts[0]), str);
+ return line_config(vts, ARRAY_SIZE(vts), str);
}
static int con_get_config(char *dev, char *str, int size, char **error_out)
{
- return line_get_config(dev, vts, sizeof(vts)/sizeof(vts[0]), str,
- size, error_out);
+ return line_get_config(dev, vts, ARRAY_SIZE(vts), str, size, error_out);
}
static int con_remove(int n)
{
- return line_remove(vts, sizeof(vts)/sizeof(vts[0]), n);
+ return line_remove(vts, ARRAY_SIZE(vts), n);
}
static int con_open(struct tty_struct *tty, struct file *filp)
@@ -170,7 +169,7 @@ int stdio_init(void)
return -1;
printk(KERN_INFO "Initialized stdio console driver\n");
- lines_init(vts, sizeof(vts)/sizeof(vts[0]));
+ lines_init(vts, ARRAY_SIZE(vts));
new_title = add_xterm_umid(opts.xterm_title);
if(new_title != NULL)
@@ -186,13 +185,13 @@ static void console_exit(void)
{
if (!con_init_done)
return;
- close_lines(vts, sizeof(vts)/sizeof(vts[0]));
+ close_lines(vts, ARRAY_SIZE(vts));
}
__uml_exitcall(console_exit);
static int console_chan_setup(char *str)
{
- return line_setup(vts, sizeof(vts)/sizeof(vts[0]), str, 1);
+ return line_setup(vts, ARRAY_SIZE(vts), str, 1);
}
__setup("con", console_chan_setup);
__channel_help(console_chan_setup, "con");
OpenPOWER on IntegriCloud