]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_date.c
Merge branch 'master' of git://www.denx.de/git/u-boot-mmc
[karo-tx-uboot.git] / common / cmd_date.c
index 8dbf16d32a1220772427fbbb133a8c9fd0282aba..0ac032cf3092e5fe7e182c63f9a23619b2bd6a7f 100644 (file)
@@ -31,7 +31,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char *weekdays[] = {
+static const char * const weekdays[] = {
        "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
 };
 
@@ -41,9 +41,9 @@ const char *weekdays[] = {
 #define RELOC(a)       a
 #endif
 
-int mk_date (char *, struct rtc_time *);
+int mk_date (const char *, struct rtc_time *);
 
-int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_date(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        struct rtc_time tm;
        int rcode = 0;
@@ -93,8 +93,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
                break;
        default:
-               cmd_usage(cmdtp);
-               rcode = 1;
+               rcode = CMD_RET_USAGE;
        }
 
        /* switch back to original I2C bus */
@@ -106,7 +105,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 /*
  * simple conversion of two-digit string with error checking
  */
-static int cnvrt2 (char *str, int *valp)
+static int cnvrt2 (const char *str, int *valp)
 {
        int val;
 
@@ -131,7 +130,7 @@ static int cnvrt2 (char *str, int *valp)
  * Some basic checking for valid values is done, but this will not catch
  * all possible error conditions.
  */
-int mk_date (char *datestr, struct rtc_time *tmp)
+int mk_date (const char *datestr, struct rtc_time *tmp)
 {
        int len, val;
        char *ptr;