mtd: quiet sparse noise in cfi.h
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Feb 25 07:59:03 EST 2010
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=1449c5d0e8f25af6c903797a636696901122e4e8
Commit: 1449c5d0e8f25af6c903797a636696901122e4e8
Parent: 53f2b1c86a1fa1414be93571062ac4c263fa9fbc
Author: H Hartley Sweeten <hartleys at visionengravers.com>
AuthorDate: Fri Jan 15 11:09:32 2010 -0700
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Feb 25 11:29:25 2010 +0000
mtd: quiet sparse noise in cfi.h
In the inline function cfi_build_cmd_addr, the cast of cmd_ofs to an
uint8_t produces a sparse warning of the type:
warning: cast truncates bits from constant value (2aa becomes aa)
Quiet the warning by masking cmd_ofs with 0xff and remove the cast.
Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
include/linux/mtd/cfi.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index df89f42..a4eefc5 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -297,7 +297,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs,
* and 32bit devices on 16 bit busses
* set the low bit of the alternating bit sequence of the address.
*/
- if (((type * interleave) > bankwidth) && ((uint8_t)cmd_ofs == 0xaa))
+ if (((type * interleave) > bankwidth) && ((cmd_ofs & 0xff) == 0xaa))
addr |= (type >> 1)*interleave;
return addr;
More information about the linux-mtd-cvs
mailing list