Skip to content

Commit

Permalink
mtd: pmc551: fix signedness bug in init_pmc551()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xi Wang authored and David Woodhouse committed Mar 26, 2012
1 parent 30ec5a2 commit 2ff5e15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/devices/pmc551.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static int pmc551_write(struct mtd_info *mtd, loff_t to, size_t len,
* mechanism
* returns the size of the memory region found.
*/
static u32 fixup_pmc551(struct pci_dev *dev)
static int fixup_pmc551(struct pci_dev *dev)
{
#ifdef CONFIG_MTD_PMC551_BUGFIX
u32 dram_data;
Expand Down Expand Up @@ -669,7 +669,7 @@ static int __init init_pmc551(void)
struct mypriv *priv;
int found = 0;
struct mtd_info *mtd;
u32 length = 0;
int length = 0;

if (msize) {
msize = (1 << (ffs(msize) - 1)) << 20;
Expand Down

0 comments on commit 2ff5e15

Please sign in to comment.