qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2 05/10] hw/sd.c: add SD card save/load support


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH V2 05/10] hw/sd.c: add SD card save/load support
Date: Wed, 11 Apr 2012 11:24:44 +0100

On 5 April 2012 16:48, Igor Mitsyanko <address@hidden> wrote:
> @@ -416,8 +421,9 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv)
>     if (sd->wp_groups)
>         g_free(sd->wp_groups);
>     sd->wp_switch = bdrv ? bdrv_is_read_only(bdrv) : false;
> +    sd->wpgrps_size = BITS_TO_LONGS(sect);
>     sd->wp_groups = bitmap_new(sect);

> @@ -565,8 +605,7 @@ static void sd_lock_command(SDState *sd)
>             sd->card_status |= LOCK_UNLOCK_FAILED;
>             return;
>         }
> -        bitmap_zero(sd->wp_groups, BITS_TO_LONGS((sd->size >> (HWBLOCK_SHIFT 
> +
> -                SECTOR_SHIFT + WPGROUP_SHIFT)) + 1));
> +        bitmap_zero(sd->wp_groups, sd->wpgrps_size);
>         sd->csd[14] &= ~0x10;
>         sd->card_status &= ~CARD_IS_LOCKED;
>         sd->pwd_len = 0;

These two hunks together are still passing a count of longs rather
than a count of bits to bitmap_zero(). If you fix this in the
earlier patch then I think you should be able to avoid having to
change the same bit of code in sd_lock_command() again in this patch.

Otherwise OK.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]