Commit fcbd5b73d77e2e8103fdea0ff23f9c61cd7e7514

Authored by Mike Frysinger
1 parent 4c95ff6419

Blackfin: otp: fix build after constification of args[]

The OTP code does a little shuffling of arguments that aren't really
necessary, so use a local variable instead to fix build errors now
that the args[] parameter is const.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Showing 1 changed file with 7 additions and 6 deletions Side-by-side Diff

... ... @@ -82,6 +82,7 @@
82 82  
83 83 int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
84 84 {
  85 + char *cmd;
85 86 uint32_t ret, base_flags;
86 87 bool prompt_user, force_read;
87 88 uint32_t (*otp_func)(uint32_t page, uint32_t flags, uint64_t *page_content);
88 89  
89 90  
90 91  
91 92  
... ... @@ -93,21 +94,21 @@
93 94  
94 95 prompt_user = false;
95 96 base_flags = 0;
96   - if (!strcmp(argv[1], "read"))
  97 + cmd = argv[1];
  98 + if (!strcmp(cmd, "read"))
97 99 otp_func = bfrom_OtpRead;
98   - else if (!strcmp(argv[1], "dump")) {
  100 + else if (!strcmp(cmd, "dump")) {
99 101 otp_func = bfrom_OtpRead;
100 102 force_read = true;
101   - } else if (!strcmp(argv[1], "write")) {
  103 + } else if (!strcmp(cmd, "write")) {
102 104 otp_func = bfrom_OtpWrite;
103 105 base_flags = OTP_CHECK_FOR_PREV_WRITE;
104 106 if (!strcmp(argv[2], "--force")) {
105   - argv[2] = argv[1];
106 107 argv++;
107 108 --argc;
108 109 } else
109 110 prompt_user = false;
110   - } else if (!strcmp(argv[1], "lock")) {
  111 + } else if (!strcmp(cmd, "lock")) {
111 112 if (argc != 4)
112 113 goto usage;
113 114 otp_func = bfrom_OtpWrite;
... ... @@ -175,7 +176,7 @@
175 176 }
176 177  
177 178 printf("OTP memory %s: addr 0x%p page 0x%03X count %zu ... ",
178   - argv[1], addr, page, count);
  179 + cmd, addr, page, count);
179 180  
180 181 set_otp_timing(otp_func == bfrom_OtpWrite);
181 182 if (otp_func == bfrom_OtpWrite && check_voltage()) {