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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71F50C4320E for ; Fri, 27 Aug 2021 07:48:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A45860FD8 for ; Fri, 27 Aug 2021 07:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244485AbhH0Hte (ORCPT ); Fri, 27 Aug 2021 03:49:34 -0400 Received: from mga17.intel.com ([192.55.52.151]:60552 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244460AbhH0Htd (ORCPT ); Fri, 27 Aug 2021 03:49:33 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10088"; a="198155927" X-IronPort-AV: E=Sophos;i="5.84,356,1620716400"; d="scan'208";a="198155927" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2021 00:48:43 -0700 X-IronPort-AV: E=Sophos;i="5.84,356,1620716400"; d="scan'208";a="537992129" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2021 00:48:39 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1mJWbJ-00EFWa-A7; Fri, 27 Aug 2021 10:48:33 +0300 Date: Fri, 27 Aug 2021 10:48:33 +0300 From: Andy Shevchenko To: Joe Perches Cc: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] vsprintf/Documentation: Add X to %*ph extension to output upper case hex Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 26, 2021 at 11:43:01AM -0700, Joe Perches wrote: > A few sysfs output uses of hex arrays are uppercase and are nominally ABI. > > Add a mechanism to the existing vsprintf %*ph hex output extension to > support upper case hex output. ... > + The preferred output is lowercase > %*ph 00 01 02 ... 3f > %*phC 00:01:02: ... :3f > %*phD 00-01-02- ... -3f > %*phN 000102 ... 3f > + Formats with X are uppercase, used for backwards compatibility > + %*phX 00 01 02 ... 3F > + %*phCX 00:01:02: ... :3F > + %*phDX 00-01-02- ... -3F > + %*phNX 000102 ... 3F Why not using %*pH...? ... > + char locase = 0x20; /* ASCII OR'd for lower case see: number() */ If you use h vs H, you may derive this from (fmt[...] & SMALL). -- With Best Regards, Andy Shevchenko