Commit d5a6d173 authored by Roel Kluin's avatar Roel Kluin Committed by Linus Torvalds

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1f693665
...@@ -77,7 +77,7 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, ...@@ -77,7 +77,7 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
struct user * dummy = NULL; struct user * dummy = NULL;
#endif #endif
if ((off & 3) || (off < 0) || (off > sizeof(struct user) - 3)) if ((off & 3) || off > sizeof(struct user) - 3)
return -EIO; return -EIO;
off >>= 2; off >>= 2;
...@@ -139,8 +139,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off, ...@@ -139,8 +139,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
struct user * dummy = NULL; struct user * dummy = NULL;
#endif #endif
if ((off & 3) || off < 0 || if ((off & 3) || off > sizeof(struct user) - 3)
off > sizeof(struct user) - 3)
return -EIO; return -EIO;
off >>= 2; off >>= 2;
......
...@@ -213,7 +213,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) ...@@ -213,7 +213,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
if (!physid_isset(phys_id, phys_cpu_present_map)) if (!physid_isset(phys_id, phys_cpu_present_map))
continue; continue;
if ((max_cpus >= 0) && (max_cpus <= cpucount + 1)) if (max_cpus <= cpucount + 1)
continue; continue;
do_boot_cpu(phys_id); do_boot_cpu(phys_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment