From: Gianni Tedesco Subject: Re: [PATCH]: Fix rombios to correctly report size of disks >16GB Date: Fri, 23 Jul 2010 09:07:40 +0100 Message-ID: <1279872460.1723.2031.camel@qabil.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen Devel List-Id: xen-devel@lists.xenproject.org On Thu, 2010-07-22 at 19:07 +0100, Keir Fraser wrote: > On 22/07/2010 18:42, "Gianni Tedesco" 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).... Gianni