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

Re: [Xen-devel] [PATCH]: Fix rombios to correctly report size of disks >16GB



On Fri, 2010-07-23 at 09:07 +0100, Gianni Tedesco wrote:
> On Thu, 2010-07-22 at 19:07 +0100, Keir Fraser wrote:
> > On 22/07/2010 18:42, "Gianni Tedesco" <gianni.tedesco@xxxxxxxxxx> wrote:
> > 
> > > Cosmetic patch for rombios to display the correct sizes of disks larger
> > > than 16GB - a problem caused by needlessly casting sizeinmb variable
> > > down to 16bits.
> > 
> > For say a 17GB drive sizeinmb=17000 which can be represented with fewer than
> > 16 bits. I don't see how the code as it is will ever print the wrong thing,
> > except for drives bigger than 64TB!
> 
> Actually you are right then wrong, the patch is mis-titled, it's 64GB.
> (in fact 65,535 MB).
> 
> > Also I'm not sure but I think the
> > integer size here may be 16 bits, and the %u format specifier would only
> > print 16-bit values in that case anyway.
> 
> I tested it and it works as advertised (modulo 16 -> 64)....

BTW. the reason for that is printf() and integer definition doesn't
change regardless of whether gcc is compiling for 16 or 32 bit mode but
just changes the logic wrt operand-size insn prefix

Gianni


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.