public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] cfi.h: quiet sparse noise
@ 2010-01-15 18:09 H Hartley Sweeten
  2010-02-02  5:58 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2010-01-15 18:09 UTC (permalink / raw)
  To: Linux Kernel, linux-mtd; +Cc: dwmw2

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.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Woodhouse <dwmw2@infradead.org>

---

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cfi.h: quiet sparse noise
  2010-01-15 18:09 [PATCH] cfi.h: quiet sparse noise H Hartley Sweeten
@ 2010-02-02  5:58 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-02-02  5:58 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: dwmw2, linux-mtd, Linux Kernel

On Fri, 2010-01-15 at 11:09 -0700, H Hartley Sweeten wrote:
> 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.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: David Woodhouse <dwmw2@infradead.org>

Pushed this one to my l2-mtd-2.6 / master
-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-02  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 18:09 [PATCH] cfi.h: quiet sparse noise H Hartley Sweeten
2010-02-02  5:58 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox