mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] EFI: report correct block device size
@ 2014-10-22 10:47 Michael Olbrich
  2014-10-23  5:32 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Olbrich @ 2014-10-22 10:47 UTC (permalink / raw)
  To: barebox; +Cc: Michael Olbrich

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

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

end of thread, other threads:[~2014-10-23  5:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-22 10:47 [PATCH] EFI: report correct block device size Michael Olbrich
2014-10-23  5:32 ` Sascha Hauer

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