mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] mtd: create bitflips in the correct page
Date: Tue, 14 Mar 2017 08:10:51 +0100	[thread overview]
Message-ID: <20170314071052.2195-1-s.hauer@pengutronix.de> (raw)

In mtd_peb_create_bitflips() buf always points to the first page in a
block. If we want to create bitflips in other pages we have to add the
offset into the block.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/peb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/peb.c b/drivers/mtd/peb.c
index 66227d4ffb..c97697f6f9 100644
--- a/drivers/mtd/peb.c
+++ b/drivers/mtd/peb.c
@@ -610,7 +610,7 @@ int mtd_peb_create_bitflips(struct mtd_info *mtd, int pnum, int offset,
 	for (i = 0; i < num_bitflips; i++) {
 		int offs;
 		int bit;
-		u8 *pos = buf;
+		u8 *pos = buf + offset;
 
 		if (random) {
 			offs = random32() % len;
-- 
2.11.0


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

             reply	other threads:[~2017-03-14  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14  7:10 Sascha Hauer [this message]
2017-03-14  7:10 ` [PATCH 2/2] mtd: when creating bitflips the offset has to be page aligned Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170314071052.2195-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox