mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd/core.c: fix MTDPGALG
@ 2011-12-31 12:56 Jean-Christophe PLAGNIOL-VILLARD
  2011-12-31 23:28 ` Robert Jarzmik
  2012-01-02 16:07 ` Eric Bénard
  0 siblings, 2 replies; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-12-31 12:56 UTC (permalink / raw)
  To: barebox

introduced in commit f76ad819e4971094
drivers/mtd: cosmetic changes

it's supposed to the invert of the writesize - 1

Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
Hi,

	Robert please test more carefully next time

	I spend time to debug this while working on at91 nand boot :(

Best Regards,
J.
 drivers/mtd/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 55d845d..f25863d 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -49,7 +49,7 @@ static 	ssize_t mtd_read(struct cdev *cdev, void* buf, size_t count,
 }
 
 #define NOTALIGNED(x) (x & (mtd->writesize - 1)) != 0
-#define MTDPGALG(x) ((x) & (mtd->writesize - 1))
+#define MTDPGALG(x) ((x) & ~(mtd->writesize - 1))
 
 #ifdef CONFIG_MTD_WRITE
 static int all_ff(const void *buf, int len)
-- 
1.7.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-01-02 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-31 12:56 [PATCH] mtd/core.c: fix MTDPGALG Jean-Christophe PLAGNIOL-VILLARD
2011-12-31 23:28 ` Robert Jarzmik
2012-01-02 16:07 ` Eric Bénard

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