summaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386/ptrace_user.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-25 23:33:00 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:49:05 -0700
commit91b165c0594ab78c64f26d26e3174e6dfd60ed9d (patch)
tree0730eefa9d4ce786f7f561e3b40700418d6d0970 /arch/um/sys-i386/ptrace_user.c
parent13c06be399902c9ebda08e092edb1614bb4a3761 (diff)
downloadblackbird-op-linux-91b165c0594ab78c64f26d26e3174e6dfd60ed9d.tar.gz
blackbird-op-linux-91b165c0594ab78c64f26d26e3174e6dfd60ed9d.zip
[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.c5
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 @@
#include "user.h"
#include "os.h"
#include "uml-config.h"
+#include "user_util.h"
int ptrace_getregs(long pid, unsigned long *regs_out)
{
@@ -51,7 +52,7 @@ static void write_debugregs(int pid, unsigned long *regs)
int nregs, i;
dummy = NULL;
- nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]);
+ nregs = ARRAY_SIZE(dummy->u_debugreg);
for(i = 0; i < nregs; i++){
if((i == 4) || (i == 5)) continue;
if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i],
@@ -68,7 +69,7 @@ static void read_debugregs(int pid, unsigned long *regs)
int nregs, i;
dummy = NULL;
- nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]);
+ nregs = ARRAY_SIZE(dummy->u_debugreg);
for(i = 0; i < nregs; i++){
regs[i] = ptrace(PTRACE_PEEKUSR, pid,
&dummy->u_debugreg[i], 0);
OpenPOWER on IntegriCloud