From: H Hartley Sweeten Date: Fri, 15 Jan 2010 18:09:32 +0000 (-0700) Subject: mtd: quiet sparse noise in cfi.h X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1449c5d0e8f25af6c903797a636696901122e4e8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index df89f4275232..a4eefc5810dc 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;