X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_date.c;h=f0fa02ae22fcb90f17136c35349f721b7f513b4e;hb=e47f2db5371047eb9bcd115fee084e6a8a92a239;hp=3141a3968aebaf27cd4a3e55eca39f07cb97508c;hpb=d52e3e0176a74c30549251e16c5c00a363c544d2;p=u-boot diff --git a/common/cmd_date.c b/common/cmd_date.c index 3141a3968a..f0fa02ae22 100644 --- a/common/cmd_date.c +++ b/common/cmd_date.c @@ -31,19 +31,19 @@ DECLARE_GLOBAL_DATA_PTR; -const char *weekdays[] = { +static const char * const weekdays[] = { "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur", }; -#ifdef CONFIG_RELOC_FIXUP_WORKS -#define RELOC(a) a -#else +#ifdef CONFIG_NEEDS_MANUAL_RELOC #define RELOC(a) ((typeof(a))((unsigned long)(a) + gd->reloc_off)) +#else +#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 *argv[]) +int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct rtc_time tm; int rcode = 0; @@ -106,7 +106,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *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 +131,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;