MIPS: Remove invalid check
authorAndrzej Hajda <[email protected]>
Mon, 21 Sep 2015 13:34:08 +0000 (15:34 +0200)
committerRalf Baechle <[email protected]>
Mon, 26 Oct 2015 08:49:39 +0000 (09:49 +0100)
Unsigned values cannot be lesser than zero.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[[email protected]: Chris Dearman's original commit
9318c51acd9689505850152cc98277a6d6f2d752 ([MIPS] MIPS32/MIPS64 secondary
cache management) introduced these less than zero checks in 2.6.18.]

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <[email protected]>
Cc: [email protected]
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: Chris Dearman <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/11165/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/mm/sc-mips.c

index 53ea8391f9bbf9c2ddf81a114e59f52d05ad7abf..1755187a654583eb3c9b7b6643999c314fd2f1ec 100644 (file)
@@ -162,13 +162,13 @@ static inline int __init mips_sc_probe(void)
                return 0;
 
        tmp = (config2 >> 8) & 0x0f;
-       if (0 <= tmp && tmp <= 7)
+       if (tmp <= 7)
                c->scache.sets = 64 << tmp;
        else
                return 0;
 
        tmp = (config2 >> 0) & 0x0f;
-       if (0 <= tmp && tmp <= 7)
+       if (tmp <= 7)
                c->scache.ways = tmp + 1;
        else
                return 0;