]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
m32r: remove redundant tests on unsigned
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 22 Sep 2009 00:04:03 +0000 (17:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2009 14:17:43 +0000 (07:17 -0700)
`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>
arch/m32r/kernel/ptrace.c
arch/m32r/kernel/smpboot.c

index 98b8feb12ed899e6dba32d0532b981057d4f5a6e..98682bba0ed9c3aedf0bc86ee43ef68e20333fc4 100644 (file)
@@ -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;
index 2547d6c4a827c3096290a65de4a708fc0279fd20..655ea1c47a0f2efccb8d4f84c58d9c4284eb7138 100644 (file)
@@ -213,7 +213,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
                if (!physid_isset(phys_id, phys_cpu_present_map))
                        continue;
 
-               if ((max_cpus >= 0) && (max_cpus <= cpucount + 1))
+               if (max_cpus <= cpucount + 1)
                        continue;
 
                do_boot_cpu(phys_id);