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=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 1AA13C07E95 for ; Tue, 20 Jul 2021 14:22:33 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 332CC6101E for ; Tue, 20 Jul 2021 14:22:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 332CC6101E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8C39982C44; Tue, 20 Jul 2021 16:22:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="bxZpFD+S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3146882C44; Tue, 20 Jul 2021 16:22:26 +0200 (CEST) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7BDFC82BDF for ; Tue, 20 Jul 2021 16:22:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x731.google.com with SMTP id bm6so7344484qkb.1 for ; Tue, 20 Jul 2021 07:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jxltmUnHf+Omp5e7jFVGyrnMIEsYtqS4qU41FdkhobA=; b=bxZpFD+S+1wSeJVeHWvg46mMRjVZCoRFYgDUyFgqF/0IjzY5PTVKHxwGFIT4bf9ZaI mOOYQIUxXvIuV3RNny3+mGfe+Gfw9LHTSe/UilygkabDQYqW2QeVX7aycVDZ9bIOoWJT 9byPuVv0Sw7Sp8ee79EsLmV2ZMCmqz6bbM5CA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jxltmUnHf+Omp5e7jFVGyrnMIEsYtqS4qU41FdkhobA=; b=W2dDAcPjCqq0fbSeVLzDYjaZNUACRc2VOx02qq+iQhHIrFbtElDns6w7AY9I1oSXH+ WPULoiDivmHt32uWJSxuHvpebuASZflcoPpxVFfsmARPkC1g8GhqGRWPWbp23xw0kX5G mjZo/KVIciiBdz4mR7lG83qBxelxhTonP0zUcSl5Jo8QE5bmrys8fUjIlAb4133SDexR U2YC1ln9rdDOVvwDJIfJEnVMHPASJ2+xJoHjuX6vjyj9N07vVgkcQeKKKlLUlO99s3Ui 8mfUADHRGtsnWBG7eh2ZL+/lZ7q6qxWjeDZ9olSGl9Ay4wttX32S/YSWLe6iDoKDb58t zNrQ== X-Gm-Message-State: AOAM532JqWYR1EYxly4sAdIWpNzFmD23Zq7OLMQ64uFVCv+BOXNnmkw9 8e27ClbR6fCW5/b7AdL+EK81nA== X-Google-Smtp-Source: ABdhPJw9xBq6i7eMxo3E/jJWAN81w0oBzwhwtqqopxEfngpXPXXcv2IVZ1Vq7mPm+HStO5h4F0ijGQ== X-Received: by 2002:a37:92c6:: with SMTP id u189mr28715774qkd.237.1626790941280; Tue, 20 Jul 2021 07:22:21 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-64f9-b69d-b720-c9f2.res6.spectrum.com. [2603:6081:7b01:cbda:64f9:b69d:b720:c9f2]) by smtp.gmail.com with ESMTPSA id c2sm7954282qtw.30.2021.07.20.07.22.19 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jul 2021 07:22:20 -0700 (PDT) Date: Tue, 20 Jul 2021 10:22:18 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Eugeniu Rosca , Roland Gaudig , Heinrich Schuchardt , Stefan Herbrechtsmeier , Sean Anderson , Marek =?iso-8859-1?Q?Beh=FAn?= , Marek Vasut , Joe Hershberger Subject: Re: [PATCH 00/15] lib: Add support for a decimal 0m prefix for numbers Message-ID: <20210720142218.GI9379@bill-the-cat> References: <20210720132940.1171011-1-sjg@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="w2Ze1fp8mKggy7lw" Content-Disposition: inline In-Reply-To: <20210720132940.1171011-1-sjg@chromium.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --w2Ze1fp8mKggy7lw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 20, 2021 at 07:29:24AM -0600, Simon Glass wrote: > U-Boot mostly uses hex for value input, largely because addresses are much > easier to understand in hex. >=20 > But in some cases a hex value is requested, but it is more convenient to > provide a decimal value. This may be because the value comes from another > source, where its base cannot be controlled. >=20 > This series adds support for a 0m prefix to indicate a decimal number. The I _really_ don't want to invent something here. When the setexpr thread came up before I went and did a little digging. Per https://en.wikipedia.org/wiki/Radix the general way to express a number is (x)y where x is the number and y is the base (and y is in base10, and also a subscript). I thought it was a bit cumbersome for general use and didn't bring it up at the time. If we're going to add some global way to always say a number is decimal, and I'm not sure I think that's a good idea even (I kind of think it might be better on a case by case basis to maybe tweak some prints so that for example "ls mmc 0:10" tells the user it's accessing partition 16 would lead to a quick "oh that's hex, #$%@!"), I think it should follow the radix notation, or if not, some other well known example. --=20 Tom --w2Ze1fp8mKggy7lw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmD23BYACgkQFHw5/5Y0 tywewwv/aim1qu1asR1+D3lSoRJzyANYjePKFSI8QJB9mSDhaavuCTf8kOOHzAzm fXGXvjjmUPGWnkcjkhFdZv1l4HuIOHd4d27DYDjvaIP8NVWFWwOuSFX3ec8/sGZx pmua1Lu+3sg5mzkq2opyjbIQEz8dj3hXRGGkFD67LpwnPTlOl5P2t42I3CQAkHUy Mrx/fKdfZmrgfAeMPfmWWG4szLoEmP12fTuvsbkZAxaqXOUcaqKGCib5RkkFP+3W b5d3EypXxLstg7khnijFoFIEUbbiWHtaj1tJbsJbgFEu4Ka/29FfXnFwlZeELgh7 e01oXFNnyJx8EyvUdHh9p9DFPheLVOCGZcQ0L8+TVZVCoHZXDBHdBdlkLZH6+2fV qF9HmI68udpkveTfnSR9NOs3oMuNVyaxfFmWHrGh8/IOP9+kgH0EWEdq3U7RqWKi UzP5xeNDlanl1i8RIH8PQnAfa2Vfhb/ZBIPwqgH/jHPSKd7KpAksyGk0zrGR+nsY 8MU10R0v =iwfM -----END PGP SIGNATURE----- --w2Ze1fp8mKggy7lw--