From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753125AbcAUVOH (ORCPT ); Thu, 21 Jan 2016 16:14:07 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59753 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbcAUVOD (ORCPT ); Thu, 21 Jan 2016 16:14:03 -0500 Subject: Re: [PATCH v2 06/11] lib/vsprintf: introduce %pl to print in human-readable form To: Andy Shevchenko , Robert Elliott , Matt Fleming , Andrew Morton , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, Rasmus Villemoes , Brian Norris , Hariprasad S References: <1452810221-116505-1-git-send-email-andriy.shevchenko@linux.intel.com> <1452810221-116505-7-git-send-email-andriy.shevchenko@linux.intel.com> From: "H. Peter Anvin" Message-ID: <56A14A03.3090403@zytor.com> Date: Thu, 21 Jan 2016 13:13:39 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1452810221-116505-7-git-send-email-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/14/16 14:23, Andy Shevchenko wrote: > Introduce a new extension for printing given unsigned long long value in > human-readable form with automatically choosen IEC binary prefix. The value is > passed by reference. Why by reference? That seems to make little sense. The prefix should not include the unit (e.g. B) as we may want to use another thing. It is also worth noting that what you have here is to generate *exact* values, which aren't always what we want. Another common thing is to round/truncate to 3 significant figures in order to get the order of magnitude clear; the prefix being so different depending on the low order bits can be confusing when an exact representation isn't needed. -hpa