cmd_date: constify
Many strings in this file need not be writable. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
908c6b627f
commit
bdbc1303cb
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
const char *weekdays[] = {
|
static const char * const weekdays[] = {
|
||||||
"Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
|
"Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ const char *weekdays[] = {
|
||||||
#define RELOC(a) a
|
#define RELOC(a) a
|
||||||
#endif
|
#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[])
|
int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
|
@ -106,7 +106,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
/*
|
/*
|
||||||
* simple conversion of two-digit string with error checking
|
* 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;
|
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
|
* Some basic checking for valid values is done, but this will not catch
|
||||||
* all possible error conditions.
|
* 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;
|
int len, val;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
Loading…
Reference in New Issue