summaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel/ptrace.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-09-22 02:04:03 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 16:17:43 +0200
commitd5a6d1739526ed8c383db3dabc232bc15603439a (patch)
tree8562c06469f310df7cdd8fe46be428207be839da /arch/m32r/kernel/ptrace.c
parentalpha: convert to asm-generic/hardirq.h (diff)
downloadlinux-d5a6d1739526ed8c383db3dabc232bc15603439a.tar.xz
linux-d5a6d1739526ed8c383db3dabc232bc15603439a.zip
m32r: remove redundant tests on unsigned
`off' and `max_cpus' are unsigned. When negative they are wrapped and caught by the other test. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m32r/kernel/ptrace.c')
-rw-r--r--arch/m32r/kernel/ptrace.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index 98b8feb12ed8..98682bba0ed9 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -77,7 +77,7 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
struct user * dummy = NULL;
#endif
- if ((off & 3) || (off < 0) || (off > sizeof(struct user) - 3))
+ if ((off & 3) || off > sizeof(struct user) - 3)
return -EIO;
off >>= 2;
@@ -139,8 +139,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
struct user * dummy = NULL;
#endif
- if ((off & 3) || off < 0 ||
- off > sizeof(struct user) - 3)
+ if ((off & 3) || off > sizeof(struct user) - 3)
return -EIO;
off >>= 2;