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/sys-i386/ptrace_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/sys-i386/ptrace_user.c')
-rw-r--r-- | arch/um/sys-i386/ptrace_user.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/um/sys-i386/ptrace_user.c b/arch/um/sys-i386/ptrace_user.c index 40aa88531446..5f3cc6685820 100644 --- a/arch/um/sys-i386/ptrace_user.c +++ b/arch/um/sys-i386/ptrace_user.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "user.h" | 15 | #include "user.h" |
16 | #include "os.h" | 16 | #include "os.h" |
17 | #include "uml-config.h" | 17 | #include "uml-config.h" |
18 | #include "user_util.h" | ||
18 | 19 | ||
19 | int ptrace_getregs(long pid, unsigned long *regs_out) | 20 | int ptrace_getregs(long pid, unsigned long *regs_out) |
20 | { | 21 | { |
@@ -51,7 +52,7 @@ static void write_debugregs(int pid, unsigned long *regs) | |||
51 | int nregs, i; | 52 | int nregs, i; |
52 | 53 | ||
53 | dummy = NULL; | 54 | dummy = NULL; |
54 | nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]); | 55 | nregs = ARRAY_SIZE(dummy->u_debugreg); |
55 | for(i = 0; i < nregs; i++){ | 56 | for(i = 0; i < nregs; i++){ |
56 | if((i == 4) || (i == 5)) continue; | 57 | if((i == 4) || (i == 5)) continue; |
57 | if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i], | 58 | if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i], |
@@ -68,7 +69,7 @@ static void read_debugregs(int pid, unsigned long *regs) | |||
68 | int nregs, i; | 69 | int nregs, i; |
69 | 70 | ||
70 | dummy = NULL; | 71 | dummy = NULL; |
71 | nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]); | 72 | nregs = ARRAY_SIZE(dummy->u_debugreg); |
72 | for(i = 0; i < nregs; i++){ | 73 | for(i = 0; i < nregs; i++){ |
73 | regs[i] = ptrace(PTRACE_PEEKUSR, pid, | 74 | regs[i] = ptrace(PTRACE_PEEKUSR, pid, |
74 | &dummy->u_debugreg[i], 0); | 75 | &dummy->u_debugreg[i], 0); |