diff options
author | Xi Wang <xi.wang@gmail.com> | 2012-01-09 16:58:25 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:11:07 -0400 |
commit | 2ff5e1532dd37e1bd8ac72da3f7f0e2b310102fb (patch) | |
tree | aace7e962810765fb37de2dc29c8b0cf77f3fbce /drivers/mtd/devices | |
parent | 30ec5a2cb17d78482de0cf9e38721410d48c086d (diff) |
mtd: pmc551: fix signedness bug in init_pmc551()
Since "length" is a u32, the error handling below didn't work when
fixup_pmc551() returns -ENODEV.
if ((length = fixup_pmc551(PCI_Device)) <= 0)
This patch changes both the type of "length" and the return type of
fixup_pmc551() to int.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/pmc551.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index ecff765579dd..cfccf6510411 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -359,7 +359,7 @@ static int pmc551_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
359 | * mechanism | 359 | * mechanism |
360 | * returns the size of the memory region found. | 360 | * returns the size of the memory region found. |
361 | */ | 361 | */ |
362 | static u32 fixup_pmc551(struct pci_dev *dev) | 362 | static int fixup_pmc551(struct pci_dev *dev) |
363 | { | 363 | { |
364 | #ifdef CONFIG_MTD_PMC551_BUGFIX | 364 | #ifdef CONFIG_MTD_PMC551_BUGFIX |
365 | u32 dram_data; | 365 | u32 dram_data; |
@@ -669,7 +669,7 @@ static int __init init_pmc551(void) | |||
669 | struct mypriv *priv; | 669 | struct mypriv *priv; |
670 | int found = 0; | 670 | int found = 0; |
671 | struct mtd_info *mtd; | 671 | struct mtd_info *mtd; |
672 | u32 length = 0; | 672 | int length = 0; |
673 | 673 | ||
674 | if (msize) { | 674 | if (msize) { |
675 | msize = (1 << (ffs(msize) - 1)) << 20; | 675 | msize = (1 << (ffs(msize) - 1)) << 20; |