Skip to content

Commit

Permalink
mtd: quiet sparse noise in cfi.h
Browse files Browse the repository at this point in the history
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@visionengravers.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
H Hartley Sweeten authored and David Woodhouse committed Feb 25, 2010
1 parent 53f2b1c commit 1449c5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/mtd/cfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1449c5d

Please sign in to comment.