Skip to content

Commit

Permalink
powerpc/85xx: Fix signedness bug in cache-sram
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kumar Gala <[email protected]>
  • Loading branch information
segoon authored and kumargala committed Mar 15, 2011
1 parent a2b31dd commit b0aea14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b0aea14

Please sign in to comment.