mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [PATCH] EFI: report correct block device size
Date: Wed, 22 Oct 2014 12:47:52 +0200	[thread overview]
Message-ID: <1413974872-23330-1-git-send-email-m.olbrich@pengutronix.de> (raw)

last_block is a zero-based block number, so the total number of blocks is
last_block + 1

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 arch/efi/efi/efi-block-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/efi/efi/efi-block-io.c b/arch/efi/efi/efi-block-io.c
index 00115317fc9b..85603d913d5b 100644
--- a/arch/efi/efi/efi-block-io.c
+++ b/arch/efi/efi/efi-block-io.c
@@ -149,7 +149,7 @@ int efi_bio_probe(struct efi_device *efidev)
 
 	priv->blk.cdev.name = asprintf("disk%d", cdev_find_free_index("disk"));
 	priv->blk.blockbits = ffs(media->block_size) - 1;
-	priv->blk.num_blocks = media->last_block;
+	priv->blk.num_blocks = media->last_block + 1;
 	priv->blk.ops = &efi_bio_ops;
 	priv->blk.dev = &efidev->dev;
 
-- 
2.1.1


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

             reply	other threads:[~2014-10-22 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 10:47 Michael Olbrich [this message]
2014-10-23  5:32 ` 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=1413974872-23330-1-git-send-email-m.olbrich@pengutronix.de \
    --to=m.olbrich@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