Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-25 Thread Tom Rini
On Wed, Jun 23, 2021 at 08:08:50AM +0200, Wolfgang Denk wrote: > Dear Simon, > > 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' beca

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-23 Thread Wolfgang Denk
Dear Roland, In message you wrote: > > > ... > >> + /* hexadecimal to decimal conversion: "setexpr name dec value" */ > >> + if (argc == 4 && (strcmp(argv[2], "dec") == 0)) { > >> + w = cmd_get_data_size(argv[3], 4); > >> + a = get_arg(argv[3], w); > >> +

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-23 Thread Roland Gaudig (OSS)
Dear Wolfgang, On Wed, 23. Jun 2021 08:03, Wolfgang Denk wrote: > > Dear Roland, > > In message <20210622135042.133904-2-roland.gaudig-...@weidmueller.com> you > wrote: >> >> This patch extends the setexpr command with a dec operator to >> convert an input value to decimal. > ... >> + /* h

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-23 Thread Roland Gaudig (OSS)
Hi Simon, On Tue, 22. Jun 2021 at 21:25, Simon Glass wrote: > > Hi Roland, > > On Tue, 22 Jun 2021 at 07:51, wrote: >> >> From: Roland Gaudig >> >> This patch extends the setexpr command with a dec operator to >> convert an input value to decimal. >> >> Signed-off-by: Roland Gaudig >> --- >>

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-22 Thread Wolfgang Denk
Dear Simon, 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

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-22 Thread Wolfgang Denk
Dear Roland, In message <20210622135042.133904-2-roland.gaudig-...@weidmueller.com> you wrote: > > This patch extends the setexpr command with a dec operator to > convert an input value to decimal. ... > + /* hexadecimal to decimal conversion: "setexpr name dec value" */ > + if (argc == 4

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-22 Thread Simon Glass
Hi Sean, On Tue, 22 Jun 2021 at 13:30, Sean Anderson wrote: > > > > On 6/22/21 3:25 PM, Simon Glass wrote: > > Hi Roland, > > > > On Tue, 22 Jun 2021 at 07:51, wrote: > >> > >> From: Roland Gaudig > >> > >> This patch extends the setexpr command with a dec operator to > >> convert an in

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-22 Thread Sean Anderson
On 6/22/21 3:25 PM, Simon Glass wrote: > Hi Roland, > > On Tue, 22 Jun 2021 at 07:51, wrote: >> >> From: Roland Gaudig >> >> This patch extends the setexpr command with a dec operator to >> convert an input value to decimal. >> >> Signed-off-by: Roland Gaudig >> --- >> >> cmd/setexpr.c | 16

Re: [PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-22 Thread Simon Glass
Hi Roland, On Tue, 22 Jun 2021 at 07:51, wrote: > > From: Roland Gaudig > > This patch extends the setexpr command with a dec operator to > convert an input value to decimal. > > Signed-off-by: Roland Gaudig > --- > > cmd/setexpr.c | 16 ++-- > 1 file changed, 14 insertions(+), 2 d

[PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

2021-06-22 Thread roland . gaudig-oss
From: Roland Gaudig This patch extends the setexpr command with a dec operator to convert an input value to decimal. Signed-off-by: Roland Gaudig --- cmd/setexpr.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/setexpr.c b/cmd/setexpr.c index e828be3