diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-21 20:04:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:43 -0400 |
commit | d5a6d1739526ed8c383db3dabc232bc15603439a (patch) | |
tree | 8562c06469f310df7cdd8fe46be428207be839da /arch | |
parent | 1f693665457539e919856149151b7a7e96550d70 (diff) |
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')
-rw-r--r-- | arch/m32r/kernel/ptrace.c | 5 | ||||
-rw-r--r-- | arch/m32r/kernel/smpboot.c | 2 |
2 files changed, 3 insertions, 4 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, | |||
77 | struct user * dummy = NULL; | 77 | struct user * dummy = NULL; |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | if ((off & 3) || (off < 0) || (off > sizeof(struct user) - 3)) | 80 | if ((off & 3) || off > sizeof(struct user) - 3) |
81 | return -EIO; | 81 | return -EIO; |
82 | 82 | ||
83 | off >>= 2; | 83 | off >>= 2; |
@@ -139,8 +139,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off, | |||
139 | struct user * dummy = NULL; | 139 | struct user * dummy = NULL; |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | if ((off & 3) || off < 0 || | 142 | if ((off & 3) || off > sizeof(struct user) - 3) |
143 | off > sizeof(struct user) - 3) | ||
144 | return -EIO; | 143 | return -EIO; |
145 | 144 | ||
146 | off >>= 2; | 145 | off >>= 2; |
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index 2547d6c4a827..655ea1c47a0f 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c | |||
@@ -213,7 +213,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
213 | if (!physid_isset(phys_id, phys_cpu_present_map)) | 213 | if (!physid_isset(phys_id, phys_cpu_present_map)) |
214 | continue; | 214 | continue; |
215 | 215 | ||
216 | if ((max_cpus >= 0) && (max_cpus <= cpucount + 1)) | 216 | if (max_cpus <= cpucount + 1) |
217 | continue; | 217 | continue; |
218 | 218 | ||
219 | do_boot_cpu(phys_id); | 219 | do_boot_cpu(phys_id); |