diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-12-15 19:37:17 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-12-15 22:26:33 -0500 |
commit | 0a032a4df6dc4a82bcd1c401e57ee71825d30c14 (patch) | |
tree | 84e55c3a9de0402bfb0064ebea588ff940ac5b80 /drivers/mtd | |
parent | caf0e8e028516253afce6e40c52f0c193a221f8a (diff) |
mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
mtd->writesize and len are unsigned so the test does not work.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 3330ea06917c..f63b1db3ffb3 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -3165,10 +3165,10 @@ static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len, | |||
3165 | 3165 | ||
3166 | /* Check User/Factory boundary */ | 3166 | /* Check User/Factory boundary */ |
3167 | if (mode == MTD_OTP_USER) { | 3167 | if (mode == MTD_OTP_USER) { |
3168 | if (((mtd->writesize * otp_pages) - (from + len)) < 0) | 3168 | if (mtd->writesize * otp_pages < from + len) |
3169 | return 0; | 3169 | return 0; |
3170 | } else { | 3170 | } else { |
3171 | if (((mtd->writesize * otp_pages) - len) < 0) | 3171 | if (mtd->writesize * otp_pages < len) |
3172 | return 0; | 3172 | return 0; |
3173 | } | 3173 | } |
3174 | 3174 | ||