]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
powerpc/85xx: Fix signedness bug in cache-sram
authorVasiliy Kulikov <segooon@gmail.com>
Sun, 17 Oct 2010 14:51:41 +0000 (18:51 +0400)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 15 Mar 2011 19:19:16 +0000 (14:19 -0500)
sram_params.sram_size and sram_params.sram_offset were unsigned.
If get_cache_sram_size() or get_cache_sram_offset() returns error code
then it is not seen to the caller.  Made sram_size and sram_offset signed.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/sysdev/fsl_85xx_l2ctlr.c

index cc8d6556d7991cca14e303aaf0eee844dcb4adb6..23b85ac9fc562e6df3b853ac66b3f343b9dd2e86 100644 (file)
@@ -94,14 +94,14 @@ static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev,
        l2cache_size = *prop;
 
        sram_params.sram_size  = get_cache_sram_size();
-       if (sram_params.sram_size <= 0) {
+       if ((int)sram_params.sram_size <= 0) {
                dev_err(&dev->dev,
                        "Entire L2 as cache, Aborting Cache-SRAM stuff\n");
                return -EINVAL;
        }
 
        sram_params.sram_offset  = get_cache_sram_offset();
-       if (sram_params.sram_offset <= 0) {
+       if ((int64_t)sram_params.sram_offset <= 0) {
                dev_err(&dev->dev,
                        "Entire L2 as cache, provide a valid sram offset\n");
                return -EINVAL;