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,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 754F3C2B9F4 for ; Fri, 25 Jun 2021 12:57:58 +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 816C561949 for ; Fri, 25 Jun 2021 12:57:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 816C561949 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 165B082C0E; Fri, 25 Jun 2021 14:57:55 +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="dQu8sVQP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0284182C11; Fri, 25 Jun 2021 14:57:53 +0200 (CEST) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 1E26F82C03 for ; Fri, 25 Jun 2021 14:57:50 +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-qt1-x82e.google.com with SMTP id f20so6568318qtk.10 for ; Fri, 25 Jun 2021 05:57:50 -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=6VXprBmnDI7wqrPLy5SkcSQLdXvETBgPht+oCsaRSMc=; b=dQu8sVQPuRuwFPSyFHVxMkOZjxIOxhlCO/w9mRoHPj7ISI14d0qPlPXRjgqWFmkUqr kvp/bqlO6nAgFIAgzZUBNL6Dzx9r0b9avrVj9sd8blApcNEnKGB2KnAbUn2ktffyvbAI p25FXauQcUe22HZrc1y23dWz0dn2d8jS3F0Xw= 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=6VXprBmnDI7wqrPLy5SkcSQLdXvETBgPht+oCsaRSMc=; b=fLAREPVv/5+sG3OWTpw8bSbYDtEGVVwpxBA6QfbGCSG6ztioDS90cV12Unrsb0CRzt ctwKxwJ58nD4wLqRNsRRfHAOHW6RlZyJmeTdECe8XqGvn6r6VRXXAXU18KSH8ER8NjK2 plcEiX5MHkZjBa+Ur5RBtz6MPIBXLhgWOHRd9yu0HUZF4hhV/BxngSzr/V3S5cOA20n8 3oLLhV++UoAlDmDQ8NFgm7ohQ932/DwMcU/UzIE2EyskIhaCst5NP+wHaAf8b4T1lGT9 ljvcMo1TTCnttg5sFagbvkXFLl6zAjnbcVoLtJpM7rlBzYzcOAIJfJJQ3hhQcQ7wsRP7 7g6g== X-Gm-Message-State: AOAM531O4G4+ldPU98KY5xC+A5wReq8u3KmG9I6XyfsLUEu5oK+a29Rx BVX6m3onFoFGZxi0IbaIVAmXAg== X-Google-Smtp-Source: ABdhPJwc2IXtdQctmhkBc4orir/e6fsy595vxPHi2hS8okTqy3bu/9uVJz3BDs00Fx29E9svHQ6fNw== X-Received: by 2002:ac8:48da:: with SMTP id l26mr9350837qtr.288.1624625869096; Fri, 25 Jun 2021 05:57:49 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-b806-617b-65c1-2cd7.res6.spectrum.com. [2603:6081:7b01:cbda:b806:617b:65c1:2cd7]) by smtp.gmail.com with ESMTPSA id f1sm4957505qkh.75.2021.06.25.05.57.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jun 2021 05:57:48 -0700 (PDT) Date: Fri, 25 Jun 2021 08:57:46 -0400 From: Tom Rini To: Wolfgang Denk Cc: Simon Glass , Sean Anderson , roland.gaudig-oss@weidmueller.com, U-Boot Mailing List , Roland Gaudig , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal Message-ID: <20210625125746.GP9516@bill-the-cat> References: <20210622135042.133904-1-roland.gaudig-oss@weidmueller.com> <20210622135042.133904-2-roland.gaudig-oss@weidmueller.com> <573f7c82-985c-cf55-ac75-b55dc408e3e4@seco.com> <223298.1624428530@gemini.denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rvoFQjWGnQhQqoBV" Content-Disposition: inline In-Reply-To: <223298.1624428530@gemini.denx.de> 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 --rvoFQjWGnQhQqoBV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 23, 2021 at 08:08:50AM +0200, Wolfgang Denk wrote: > Dear Simon, >=20 > In message you wrote: > > > > > > 0m123 ? ('m' for deciMal). > > > > > > Perhaps 0d123? Though I would prefer to remove many of the implicit > > > assumptions of hex input. > > > > Right, we can't use 'd' because it is valid hex. > > > > I believe hex is the right default. We just need an easy way to use dec= imal. >=20 > Maybe we should make this more general and support an even wirder > range of formats? Instead of just converting to decimal, we could > pass a format string for sprintf() ? >=20 > Like: >=20 > # setexpr foo fmt %d $value I like this idea as well. --=20 Tom --rvoFQjWGnQhQqoBV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGyBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDV0soACgkQFHw5/5Y0 tyzuLwv415hV4Y2A9+Ivjrr/eKIfJGdYm3BdDxjZAiE/+k851pvoIsKUIfzadflw 2X+nOzcNW7hPgkndKjgqnCcyBET3sNnUAocL1PuDjtfXT2ydtPmgLkJc36DOWS7t RqIXs8HDRe2dlAXIDbXzcEIZTJHy30DEpvjJvAUhMMoJnfZlevngTt6R17Ped178 jx+RQDqAgIdpDN6MfkI6DJygLGQk2k+Wc/C8hBUQwZEIBQBV2m3dna7dSfnp8z50 UCjOcqYbQSoaLTKJyozDSDVvOogP+mpgiqI1ckOEC4Q+SFWy6rIgKXueHgnzcKC0 sr0Vc66C4cgfkVZAQGqptw9Zg+GzFzJBFNA57BSsOltllCWBVNaq9JUmbxuIU/SA u9YzUqbGHszgjemYm7oURh03bLVPAYsgBjVcme4/FduMjT1a5f4skAdVFNh1JdtE nsDGo3bMkf+msjH9eQZSH4c0XOCPBqISn5L7IEEk4iNHrCRJH0Pw2qVw94wko++m mdKW0r0= =cIy9 -----END PGP SIGNATURE----- --rvoFQjWGnQhQqoBV--