Skip to contentSkip to conversation

cfi.h: quiet sparse noise

PATCH In review H Hartley Sweeten 2 participants 2 messages Jan 15, 2010 – Feb 2, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfi.h: quiet sparse noise

cfi.h: quiet sparse noise

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.

---

include/linux/mtd/cfi.h +1 -1
index df89f42..a4eefc5 100644
@@ -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;
#1 lore raw
Quoted 11 lines · H Hartley Sweeten

cfi.h: quiet sparse noise

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.

Pushed this one to my l2-mtd-2.6 / master

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)