public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] Orion NAND: Make dword load asm volatile to avoid GCC optimizing it away
@ 2009-07-14 14:41 Simon Kagstrom
  2009-07-14 16:40 ` Nicolas Pitre
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Kagstrom @ 2009-07-14 14:41 UTC (permalink / raw)
  To: linux-mtd

GCC 4.3.3 happily removes the dword load instruction in
orion_nand_read_buf. This patch makes the inline assembly volatile to
avoid this situation.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
 drivers/mtd/nand/orion_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 7ad9722..3f9b113 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -61,7 +61,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
 	buf64 = (uint64_t *)buf;
 	while (i < len/8) {
 		uint64_t x;
-		asm ("ldrd\t%0, [%1]" : "=r" (x) : "r" (io_base));
+		asm volatile ("ldrd\t%0, [%1]" : "=r" (x) : "r" (io_base));
 		buf64[i++] = x;
 	}
 	i *= 8;
-- 
1.6.0.4

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

end of thread, other threads:[~2009-08-21  6:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 14:41 [PATCH] Orion NAND: Make dword load asm volatile to avoid GCC optimizing it away Simon Kagstrom
2009-07-14 16:40 ` Nicolas Pitre
2009-08-19  7:45   ` Simon Kagstrom
2009-08-19 14:47     ` Nicolas Pitre
2009-08-20  7:19       ` Simon Kagstrom
2009-08-20 16:14         ` Nicolas Pitre
2009-08-21  6:07           ` Simon Kagstrom

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