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! 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.
-- Keir
> Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
>
> diff -r 01917c0da12a tools/firmware/rombios/rombios.c
> --- a/tools/firmware/rombios/rombios.c Thu Jul 22 13:49:40 2010 +0100
> +++ b/tools/firmware/rombios/rombios.c Thu Jul 22 18:40:26 2010 +0100
> @@ -2856,9 +2856,9 @@ void ata_detect( )
> printf("ata%d %s: ",channel,slave?" slave":"master");
> i=0; while(c=read_byte(get_SS(),model+i++)) printf("%c",c);
> if (sizeinmb < (1UL<<16))
> - printf(" ATA-%d Hard-Disk (%4u MBytes)\n", version,
> (Bit16u)sizeinmb);
> + printf(" ATA-%d Hard-Disk (%4u MBytes)\n", version, sizeinmb);
> else
> - printf(" ATA-%d Hard-Disk (%4u GBytes)\n", version,
> (Bit16u)(sizeinmb>>10));
> + printf(" ATA-%d Hard-Disk (%4u GBytes)\n", version,
> (sizeinmb>>10));
> break;
> case ATA_TYPE_ATAPI:
> printf("ata%d %s: ",channel,slave?" slave":"master");
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|