Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753881AbYHaPUv (ORCPT ); Sun, 31 Aug 2008 11:20:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751450AbYHaPUl (ORCPT ); Sun, 31 Aug 2008 11:20:41 -0400 Received: from proxima.lp0.eu ([85.158.45.36]:48357 "EHLO proxima.lp0.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbYHaPUk (ORCPT ); Sun, 31 Aug 2008 11:20:40 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=exim; d=fire.lp0.eu; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=NJOsbM+p4rrRL10fd5E6yth8KD70R+2Kn/9anq+h5/EkydK9gTDmzIVaXEH9pa4VIpJZNbS+XFLcyKSl63mNShQh6dlGmIGsE8nz0Ww5M6Lz5qMbqbnnw90gUWayz4ek; Message-ID: <48BAB6C4.20007@simon.arlott.org.uk> Date: Sun, 31 Aug 2008 16:20:36 +0100 From: Simon Arlott User-Agent: Thunderbird 2.0.0.16 (X11/20080726) MIME-Version: 1.0 To: James Bottomley CC: Matthew Wilcox , Linux Kernel Mailing List , linux-scsi Subject: Re: [PATCH 1/2] lib: add generic helper to print sizes rounded to the correct SI range References: <48B9546B.4010004@simon.arlott.org.uk> <1220117091.3615.3.camel@localhost.localdomain> <20080830174516.GD1239@parisc-linux.org> <48B9B552.8060406@simon.arlott.org.uk> <48B9B588.7060709@simon.arlott.org.uk> <1220147947.3615.18.camel@localhost.localdomain> <20080831025412.GJ1239@parisc-linux.org> <1220195310.4021.4.camel@localhost.localdomain> <1220195634.4021.9.camel@localhost.localdomain> In-Reply-To: <1220195634.4021.9.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 836 Lines: 21 On 31/08/08 16:13, James Bottomley wrote: > This patch adds the ability to print sizes in either units of 10^3 (SI) > or 2^10 (Binary) units. It rounds up to three significant figures and > can be used for either memory or storage capacities. > + const char *units_2[] = {"B", "Kib", "MiB", "GiB", "TiB", "PiB", I think this should have been "KiB". I'd prefer an option to display these without the "i"... Oh and you need to store the original capacity before it's re-scaled to 512 bytes. Outputting sdkp->capacity at that stage it'll be a count of 512-byte sectors. -- Simon Arlott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/