[U-Boot] [PATCH] itest: Add bitwise and operator

Wolfgang Denk wd at denx.de
Fri May 3 21:08:08 CEST 2013


Dear Eric Nelson,

In message <1367606863-14846-1-git-send-email-eric.nelson at boundarydevices.com> you wrote:
> Signed-off-by: Eric Nelson <eric.nelson at boundarydevices.com>
> ---
>  common/cmd_itest.c        |    4 ++++
>  doc/README.commands.itest |   10 +++++++++-
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/common/cmd_itest.c b/common/cmd_itest.c
> index 2c8e5d0..0629b09 100644
> --- a/common/cmd_itest.c
> +++ b/common/cmd_itest.c
> @@ -38,6 +38,7 @@
>  #define GT	3
>  #define LE	4
>  #define GE	5
> +#define AND	6

It does not make much sense to me to add AND, when you not also add
OR (and eventually XOR).

Also, now the help message is no longer correct - it says:

189 U_BOOT_CMD(
190         itest, 4, 0, do_itest,
191         "return true/false on integer compare",
192         "[.b, .w, .l, .s] [*]value1 <op> [*]value2"
193 );

but we no longer compare...


Hm, re-reading this I think this is the wrong approach.  This stuff
does not belong into the "itest" command which really is for
comparing, and NOT for operations on the arguments.

If you need operations, then please use "setexpr" - which already has
all of this, and more.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Pardon me for breathing, which I never do anyway so I don't know why
I bother to say it, oh God, I'm so depressed. Here's another of those
self-satisfied doors. Life! Don't talk to me about life."
                                        - Marvin the Paranoid Android


More information about the U-Boot mailing list