]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_test.c
sdhci: Add sdhci support for spear devices
[u-boot] / common / cmd_test.c
index 3cdd07bf32685f23a6256700956ef7765b9c9e4d..acc0ecf99b760c0de60b98145f41a0d4b4a066a0 100644 (file)
  * MA 02111-1307 USA
  */
 
+/*
+ * Define _STDBOOL_H here to avoid macro expansion of true and false.
+ * If the future code requires macro true or false, remove this define
+ * and undef true and false before U_BOOT_CMD. This define and comment
+ * shall be removed if change to U_BOOT_CMD is made to take string
+ * instead of stringifying it.
+ */
+#define _STDBOOL_H
+
 #include <common.h>
 #include <command.h>
 
-int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       char **ap;
+       char * const *ap;
        int left, adv, expr, last_expr, neg, last_cmp;
 
        /* args? */
        if (argc < 3)
                return 1;
 
-#if 0
+#ifdef DEBUG
        {
-               printf("test:");
+               debug("test(%d):", argc);
                left = 1;
                while (argv[left])
-                       printf(" %s", argv[left++]);
+                       debug(" '%s'", argv[left++]);
        }
 #endif
 
@@ -149,3 +158,25 @@ U_BOOT_CMD(
        "minimal test like /bin/sh",
        "[args..]"
 );
+
+static int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       return 1;
+}
+
+U_BOOT_CMD(
+       false,  CONFIG_SYS_MAXARGS,     1,      do_false,
+       "do nothing, unsuccessfully",
+       NULL
+);
+
+static int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       return 0;
+}
+
+U_BOOT_CMD(
+       true,   CONFIG_SYS_MAXARGS,     1,      do_true,
+       "do nothing, successfully",
+       NULL
+);