[PATCH] EFI: report correct block device size

Sascha Hauer s.hauer at pengutronix.de
Wed Oct 22 22:32:15 PDT 2014


On Wed, Oct 22, 2014 at 12:47:52PM +0200, Michael Olbrich wrote:
> 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 at pengutronix.de>

Applied, thanks

Sascha

> ---
>  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 at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list