Commit cd8c87756a46ae3544e563793ce8c18efd1091d1

Authored by Joakim Tjernlund
Committed by Wolfgang Denk
1 parent 2cc195e0a5

Fix a few gcc warnings.

Noticed while building all of mpc8xx. Also
constify usage string in timer.c
Warnings fixed are:
timer.c: In function 'timer':
timer.c:189: warning: format not a string literal and no format arguments
timer.c:258: warning: format not a string literal and no format arguments
atm.c: In function 'atmUnload':
atm.c:99: warning: array subscript is above array bounds
atm.c: In function 'atmLoad':
atm.c:65: warning: array subscript is above array bounds
codec.c: In function 'codsp_write_pop_int':
codec.c:678: warning: array subscript is above array bounds
codec.c: In function 'codsp_write_cop_short':
codec.c:585: warning: array subscript is above array bounds
codec.c: In function 'codsp_write_sop_int':
codec.c:512: warning: array subscript is above array bounds

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>

Showing 3 changed files with 8 additions and 8 deletions Side-by-side Diff

... ... @@ -502,7 +502,7 @@
502 502  
503 503 void codsp_write_sop_int(int duslic_id, int channel, unsigned char regno, unsigned int val)
504 504 {
505   - unsigned char cmd[5];
  505 + unsigned char cmd[6];
506 506  
507 507 cmd[0] = CODSP_WR | CODSP_ADR(channel) | CODSP_CMD_SOP;
508 508 cmd[1] = regno;
... ... @@ -577,7 +577,7 @@
577 577  
578 578 void codsp_write_cop_short(int duslic_id, int channel, unsigned char addr, unsigned short val)
579 579 {
580   - unsigned char cmd[3];
  580 + unsigned char cmd[4];
581 581  
582 582 cmd[0] = CODSP_WR | CODSP_OP | CODSP_ADR(channel) | CODSP_CMD_COP;
583 583 cmd[1] = addr;
... ... @@ -668,7 +668,7 @@
668 668 void codsp_write_pop_int (int duslic_id, int channel, unsigned char regno,
669 669 unsigned int val)
670 670 {
671   - unsigned char cmd[5];
  671 + unsigned char cmd[6];
672 672  
673 673 cmd[0] = CODSP_WR | CODSP_ADR (channel) | CODSP_CMD_POP;
674 674 cmd[1] = regno;
board/siemens/IAD210/atm.c
... ... @@ -62,7 +62,7 @@
62 62 volatile iop8xx_t *iop = &immap->im_ioport;
63 63  
64 64 timers->cpmt_tgcr &= 0x0FFF; SYNC; /* Disable Timer 4 */
65   - immap->im_cpm.cp_scc[4].scc_gsmrl = 0x0; SYNC; /* Disable SCC4 */
  65 + immap->im_cpm.cp_scc[3].scc_gsmrl = 0x0; SYNC; /* Disable SCC4 */
66 66 iop->iop_pdpar &= 0x3FFF; SYNC; /* Disable SAR and UTOPIA */
67 67  
68 68 if ( atmMemInit() != OK ) return ERROR;
... ... @@ -96,7 +96,7 @@
96 96 volatile iop8xx_t *iop = &immap->im_ioport;
97 97  
98 98 timers->cpmt_tgcr &= 0x0FFF; SYNC; /* Disable Timer 4 */
99   - immap->im_cpm.cp_scc[4].scc_gsmrl = 0x0; SYNC; /* Disable SCC4 */
  99 + immap->im_cpm.cp_scc[3].scc_gsmrl = 0x0; SYNC; /* Disable SCC4 */
100 100 iop->iop_pdpar &= 0x3FFF; SYNC; /* Disable SAR and UTOPIA */
101 101 g_atm.loaded = FALSE;
102 102 }
examples/standalone/timer.c
... ... @@ -113,7 +113,7 @@
113 113  
114 114 void setPeriod (tid_8xx_cpmtimer_t *hwp, ulong interval);
115 115  
116   -static char *usage = "\n[q, b, e, ?] ";
  116 +static const char usage[] = "\n[q, b, e, ?] ";
117 117  
118 118 int timer (int argc, char * const argv[])
119 119 {
... ... @@ -186,7 +186,7 @@
186 186 /* clear all events */
187 187 *hwp->terp = (CPMT_EVENT_CAP | CPMT_EVENT_REF);
188 188  
189   - printf (usage);
  189 + puts(usage);
190 190 running = 0;
191 191 while ((c = getc()) != 'q') {
192 192 if (c == 'b') {
... ... @@ -255,7 +255,7 @@
255 255 } else {
256 256 printf ("\nEnter: q - quit, b - start timer, e - stop timer, ? - get status\n");
257 257 }
258   - printf (usage);
  258 + puts(usage);
259 259 }
260 260 if (running) {
261 261 printf ("Stopping timer\n");