diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-09-26 02:33:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:49:05 -0400 |
commit | 91b165c0594ab78c64f26d26e3174e6dfd60ed9d (patch) | |
tree | 0730eefa9d4ce786f7f561e3b40700418d6d0970 /arch/um/drivers/mconsole_user.c | |
parent | 13c06be399902c9ebda08e092edb1614bb4a3761 (diff) |
[PATCH] uml: Use ARRAY_SIZE more assiduously
There were a bunch of missed ARRAY_SIZE opportunities.
Also, some formatting fixes in the affected areas of code.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/mconsole_user.c')
-rw-r--r-- | arch/um/drivers/mconsole_user.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c index 9bfd405c3bd8..5b2f5fe9e426 100644 --- a/arch/um/drivers/mconsole_user.c +++ b/arch/um/drivers/mconsole_user.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "user.h" | 16 | #include "user.h" |
17 | #include "mconsole.h" | 17 | #include "mconsole.h" |
18 | #include "umid.h" | 18 | #include "umid.h" |
19 | #include "user_util.h" | ||
19 | 20 | ||
20 | static struct mconsole_command commands[] = { | 21 | static struct mconsole_command commands[] = { |
21 | /* With uts namespaces, uts information becomes process-specific, so | 22 | /* With uts namespaces, uts information becomes process-specific, so |
@@ -65,14 +66,14 @@ static struct mconsole_command *mconsole_parse(struct mc_request *req) | |||
65 | struct mconsole_command *cmd; | 66 | struct mconsole_command *cmd; |
66 | int i; | 67 | int i; |
67 | 68 | ||
68 | for(i=0;i<sizeof(commands)/sizeof(commands[0]);i++){ | 69 | for(i = 0; i < ARRAY_SIZE(commands); i++){ |
69 | cmd = &commands[i]; | 70 | cmd = &commands[i]; |
70 | if(!strncmp(req->request.data, cmd->command, | 71 | if(!strncmp(req->request.data, cmd->command, |
71 | strlen(cmd->command))){ | 72 | strlen(cmd->command))){ |
72 | return(cmd); | 73 | return cmd; |
73 | } | 74 | } |
74 | } | 75 | } |
75 | return(NULL); | 76 | return NULL; |
76 | } | 77 | } |
77 | 78 | ||
78 | #define MIN(a,b) ((a)<(b) ? (a):(b)) | 79 | #define MIN(a,b) ((a)<(b) ? (a):(b)) |