From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D75B3C433F5 for ; Mon, 25 Apr 2022 04:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239673AbiDYEwS (ORCPT ); Mon, 25 Apr 2022 00:52:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiDYEwQ (ORCPT ); Mon, 25 Apr 2022 00:52:16 -0400 Received: from relay5.hostedemail.com (relay5.hostedemail.com [64.99.140.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D701C6571 for ; Sun, 24 Apr 2022 21:49:05 -0700 (PDT) Received: from omf04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 76B4B26104; Mon, 25 Apr 2022 04:49:03 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA id 43C5620027; Mon, 25 Apr 2022 04:49:01 +0000 (UTC) Message-ID: <9ab6601364a16c782ca36ab22a2c67face0785a7.camel@perches.com> Subject: Re: [PATCH v2 1/8] lib/printbuf: New data structure for heap-allocated strings From: Joe Perches To: Kent Overstreet , Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, hch@lst.de, hannes@cmpxchg.org, akpm@linux-foundation.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, roman.gushchin@linux.dev Date: Sun, 24 Apr 2022 21:48:58 -0700 In-Reply-To: <20220425041909.hcyirjphrkhxz6hx@moria.home.lan> References: <20220421234837.3629927-1-kent.overstreet@gmail.com> <20220421234837.3629927-7-kent.overstreet@gmail.com> <20220425041909.hcyirjphrkhxz6hx@moria.home.lan> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 43C5620027 X-Stat-Signature: 8ixc8cziybhcpcydbdn3a73gyuqoij5i X-Rspamd-Server: rspamout01 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18F4WG3efadNZRt+nKwL12BAjeAFjDke3g= X-HE-Tag: 1650862141-114345 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Mon, 2022-04-25 at 00:19 -0400, Kent Overstreet wrote: > On Mon, Apr 25, 2022 at 03:44:34AM +0100, Matthew Wilcox wrote: > > On Sun, Apr 24, 2022 at 04:46:03PM -0700, Joe Perches wrote: > > > > + * pr_human_readable_u64, pr_human_readable_s64: Print an integer with human > > > > + * readable units. > > > > > > Why not extend vsprintf for this using something like %pH[8|16|32|64] > > > or %pH[c|s|l|ll|uc|us|ul|ull] ? > > > > The %pX extension we have is _cute_, but ultimately a bad idea. It > > centralises all kinds of unrelated things in vsprintf.c, eg bdev_name() > > and clock() and ip_addr_string(). > > And it's not remotely discoverable. I didn't realize we had bdev_name() > available as a format string until just now or I would've been using it! Documentation/core-api/printk-formats.rst