qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V2 01/10] hw/sd.c: convert wp_groups in SDState


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH V2 01/10] hw/sd.c: convert wp_groups in SDState to bitfield
Date: Wed, 11 Apr 2012 15:05:32 +0100
User-agent: KMail/1.13.7 (Linux/3.0.0-2-amd64; KDE/4.6.5; x86_64; ; )

> >> static uint32_t addr_to_wpnum(uint64_t addr) {
> >>     return addr>>  (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT);
> >> }
> > 
> > This implicitly limits max address to 0xFFFFFFFF << (HWBLOCK_SHIFT +
> > SECTOR_SHIFT + WPGROUP_SHIFT), have you done this on purpose?
> 
> You could argue for uint64_t return type, but we have to pass
> the result to the bitmap functions anyway, so there is implicitly
> a limit. I don't think it's a particularly severe one.

Isn't the correct answer the same type as the bitmap code uses for bit 
numbers?  By my reading this is "int".

Paul



reply via email to

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