]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_test.c
MX28: DMA: make mxs_dma_flush_desc() static
[karo-tx-uboot.git] / common / cmd_test.c
index 3cdd07bf32685f23a6256700956ef7765b9c9e4d..bacc3684069b89f39b899cb21a19f33379328bbe 100644 (file)
@@ -2,43 +2,36 @@
  * Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
+/*
+ * 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 +142,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
+);