diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_autoscript.c | 4 | ||||
-rw-r--r-- | common/cmd_bootm.c | 18 | ||||
-rw-r--r-- | common/cmd_doc.c | 16 | ||||
-rw-r--r-- | common/cmd_ext2.c | 2 | ||||
-rw-r--r-- | common/cmd_fpga.c | 2 | ||||
-rw-r--r-- | common/cmd_i2c.c | 4 | ||||
-rw-r--r-- | common/cmd_ide.c | 6 | ||||
-rw-r--r-- | common/cmd_immap.c | 1 | ||||
-rw-r--r-- | common/cmd_load.c | 2 | ||||
-rw-r--r-- | common/cmd_log.c | 2 | ||||
-rw-r--r-- | common/cmd_mem.c | 4 | ||||
-rw-r--r-- | common/cmd_nand.c | 18 | ||||
-rw-r--r-- | common/cmd_nvedit.c | 18 | ||||
-rw-r--r-- | common/cmd_pcmcia.c | 6 | ||||
-rw-r--r-- | common/cmd_scsi.c | 6 | ||||
-rw-r--r-- | common/cmd_spi.c | 2 | ||||
-rw-r--r-- | common/cmd_usb.c | 10 | ||||
-rw-r--r-- | common/env_common.c | 2 | ||||
-rw-r--r-- | common/env_flash.c | 6 | ||||
-rw-r--r-- | common/flash.c | 4 | ||||
-rw-r--r-- | common/fpga.c | 24 | ||||
-rw-r--r-- | common/hush.c | 16 | ||||
-rw-r--r-- | common/kgdb.c | 10 | ||||
-rw-r--r-- | common/lcd.c | 14 | ||||
-rw-r--r-- | common/main.c | 2 | ||||
-rw-r--r-- | common/soft_i2c.c | 2 | ||||
-rw-r--r-- | common/usb_storage.c | 8 | ||||
-rw-r--r-- | common/xilinx.c | 8 |
28 files changed, 109 insertions, 108 deletions
diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c index 2d1f4314399..e3253022dc9 100644 --- a/common/cmd_autoscript.c +++ b/common/cmd_autoscript.c @@ -76,7 +76,7 @@ autoscript (ulong addr) hdr->ih_hcrc = 0; len = sizeof (image_header_t); data = (ulong)hdr; - if (crc32(0, (char *)data, len) != crc) { + if (crc32(0, (uchar *)data, len) != crc) { puts ("Bad header crc\n"); return 1; } @@ -85,7 +85,7 @@ autoscript (ulong addr) len = ntohl(hdr->ih_size); if (verify) { - if (crc32(0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { + if (crc32(0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) { puts ("Bad data crc\n"); return 1; } diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index ee1b5c1c242..558922c1030 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -201,7 +201,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) checksum = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; - if (crc32 (0, (char *)data, len) != checksum) { + if (crc32 (0, (uchar *)data, len) != checksum) { puts ("Bad Header Checksum\n"); SHOW_BOOT_PROGRESS (-2); return 1; @@ -225,7 +225,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (verify) { puts (" Verifying Checksum ... "); - if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { + if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) { printf ("Bad Data CRC\n"); SHOW_BOOT_PROGRESS (-3); return 1; @@ -633,7 +633,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, checksum = hdr->ih_hcrc; hdr->ih_hcrc = 0; - if (crc32 (0, (char *)data, len) != checksum) { + if (crc32 (0, (uchar *)data, len) != checksum) { puts ("Bad Header Checksum\n"); SHOW_BOOT_PROGRESS (-11); do_reset (cmdtp, flag, argc, argv); @@ -661,13 +661,13 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if (chunk > CHUNKSZ) chunk = CHUNKSZ; - csum = crc32 (csum, (char *)cdata, chunk); + csum = crc32 (csum, (uchar *)cdata, chunk); cdata += chunk; WATCHDOG_RESET(); } #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */ - csum = crc32 (0, (char *)data, len); + csum = crc32 (0, (uchar *)data, len); #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */ if (csum != hdr->ih_dcrc) { @@ -1079,7 +1079,7 @@ static int image_info (ulong addr) checksum = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; - if (crc32 (0, (char *)data, len) != checksum) { + if (crc32 (0, (uchar *)data, len) != checksum) { puts (" Bad Header Checksum\n"); return 1; } @@ -1091,7 +1091,7 @@ static int image_info (ulong addr) len = ntohl(hdr->ih_size); puts (" Verifying Checksum ... "); - if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { + if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) { puts (" Bad Data CRC\n"); return 1; } @@ -1136,7 +1136,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) checksum = ntohl(header.ih_hcrc); header.ih_hcrc = 0; - if (crc32 (0, (char *)&header, sizeof(image_header_t)) + if (crc32 (0, (uchar *)&header, sizeof(image_header_t)) != checksum) goto next_sector; @@ -1147,7 +1147,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) len = ntohl(hdr->ih_size); puts (" Verifying Checksum ... "); - if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { + if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) { puts (" Bad Data CRC\n"); } puts ("OK\n"); diff --git a/common/cmd_doc.c b/common/cmd_doc.c index e5db1bc360b..5e9bea30450 100644 --- a/common/cmd_doc.c +++ b/common/cmd_doc.c @@ -143,7 +143,7 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) cmd ? "read" : "write", curr_device, off, size); ret = doc_rw(doc_dev_desc + curr_device, cmd, off, size, - &total, (u_char*)addr); + (size_t *)&total, (u_char*)addr); printf ("%d bytes %s: %s\n", total, cmd ? "read" : "write", ret ? "ERROR" : "OK"); @@ -304,12 +304,12 @@ int doc_rw (struct DiskOnChip* this, int cmd, if (cmd) ret = doc_read_ecc(this, from, len, - &n, (u_char*)buf, - noecc ? NULL : eccbuf); + (size_t *)&n, (u_char*)buf, + noecc ? (uchar *)NULL : (uchar *)eccbuf); else ret = doc_write_ecc(this, from, len, - &n, (u_char*)buf, - noecc ? NULL : eccbuf); + (size_t *)&n, (u_char*)buf, + noecc ? (uchar *)NULL : (uchar *)eccbuf); if (ret) break; @@ -804,7 +804,7 @@ static int find_boot_record(struct NFTLrecord *nftl) /* Check for ANAND header first. Then can whinge if it's found but later checks fail */ if ((ret = doc_read_ecc(nftl->mtd, block * nftl->EraseSize, SECTORSIZE, - &retlen, buf, NULL))) { + (size_t *)&retlen, buf, NULL))) { static int warncount = 5; if (warncount) { @@ -829,7 +829,7 @@ static int find_boot_record(struct NFTLrecord *nftl) /* To be safer with BIOS, also use erase mark as discriminant */ if ((ret = doc_read_oob(nftl->mtd, block * nftl->EraseSize + SECTORSIZE + 8, - 8, &retlen, (char *)&h1) < 0)) { + 8, (size_t *)&retlen, (uchar *)&h1) < 0)) { #ifdef NFTL_DEBUG printf("ANAND header found at 0x%x, but OOB data read failed\n", block * nftl->EraseSize); @@ -902,7 +902,7 @@ static int find_boot_record(struct NFTLrecord *nftl) /* read one sector for every SECTORSIZE of blocks */ if ((ret = doc_read_ecc(nftl->mtd, block * nftl->EraseSize + i + SECTORSIZE, SECTORSIZE, - &retlen, buf, (char *)&oob)) < 0) { + (size_t *)&retlen, buf, (uchar *)&oob)) < 0) { puts ("Read of bad sector table failed\n"); return -1; } diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c index af836cd614e..927e22f0300 100644 --- a/common/cmd_ext2.c +++ b/common/cmd_ext2.c @@ -231,7 +231,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(1); } - if (strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) { + if (strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) { printf ("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n", info.type); diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index c4b73929493..9a01e7df8b6 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -69,7 +69,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size) unsigned int i; int rc; - dataptr = fpgadata; + dataptr = (unsigned char *)fpgadata; #if CFG_FPGA_XILINX /* skip the first bytes of the bitsteam, their meaning is unknown */ diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 2e44c7fde1e..c543bb53148 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -461,7 +461,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) */ do { printf("%08lx:", addr); - if(i2c_read(chip, addr, alen, (char *)&data, size) != 0) { + if(i2c_read(chip, addr, alen, (uchar *)&data, size) != 0) { puts ("\nError reading the chip,\n"); } else { data = cpu_to_be32(data); @@ -510,7 +510,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) */ reset_cmd_timeout(); #endif - if(i2c_write(chip, addr, alen, (char *)&data, size) != 0) { + if(i2c_write(chip, addr, alen, (uchar *)&data, size) != 0) { puts ("Error writing the chip.\n"); } #ifdef CFG_EEPROM_PAGE_WRITE_DELAY_MS diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 1adfe2bfaf8..6663dea2f4a 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -417,8 +417,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) SHOW_BOOT_PROGRESS (-1); return 1; } - if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) && - (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) { + if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) && + (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) { printf ("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n", info.type); @@ -450,7 +450,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) checksum = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; - if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) { + if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) { puts ("\n** Bad Header Checksum **\n"); SHOW_BOOT_PROGRESS (-2); return 1; diff --git a/common/cmd_immap.c b/common/cmd_immap.c index f1b05357c8a..559d7b4c300 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -383,6 +383,7 @@ do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (rcode == 0) { iopin.port = port; iopin.pin = pin; + iopin.flag = 0; switch (cmd) { case DIR: if (value) diff --git a/common/cmd_load.c b/common/cmd_load.c index b85db69e131..749849711a0 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -166,7 +166,7 @@ load_serial (ulong offset) if (addr2info(store_addr)) { int rc; - rc = flash_write((uchar *)binbuf,store_addr,binlen); + rc = flash_write((char *)binbuf,store_addr,binlen); if (rc != 0) { flash_perror (rc); return (~0); diff --git a/common/cmd_log.c b/common/cmd_log.c index 57ef48461a5..efc9689c298 100644 --- a/common/cmd_log.c +++ b/common/cmd_log.c @@ -179,7 +179,7 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) case 2: if (strcmp(argv[1],"show") == 0) { for (i=0; i < (log_size&LOGBUFF_MASK); i++) { - s = log_buf+((log_start+i)&LOGBUFF_MASK); + s = (char *)log_buf+((log_start+i)&LOGBUFF_MASK); putc (*s); } return 0; diff --git a/common/cmd_mem.c b/common/cmd_mem.c index bafb1d6792d..0f4f9b73df9 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -179,7 +179,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #endif puts (" "); - cp = linebuf; + cp = (u_char *)linebuf; for (i=0; i<linebytes; i++) { if ((*cp < 0x20) || (*cp > 0x7e)) putc ('.'); @@ -430,7 +430,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) puts ("Copy to Flash... "); - rc = flash_write ((uchar *)addr, dest, count*size); + rc = flash_write ((char *)addr, dest, count*size); if (rc != 0) { flash_perror (rc); return (1); diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 5648ab21785..b0c01d1205a 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -200,12 +200,12 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* read out-of-band data */ if (cmd & NANDRW_READ) { ret = nand_read_oob(nand_dev_desc + curr_device, - off, size, &total, + off, size, (size_t *)&total, (u_char*)addr); } else { ret = nand_write_oob(nand_dev_desc + curr_device, - off, size, &total, + off, size, (size_t *)&total, (u_char*)addr); } return ret; @@ -241,7 +241,7 @@ int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) curr_device, off, size); ret = nand_rw(nand_dev_desc + curr_device, cmd, off, size, - &total, (u_char*)addr); + (size_t *)&total, (u_char*)addr); printf (" %d bytes %s: %s\n", total, (cmd & NANDRW_READ) ? "read" : "written", @@ -401,7 +401,7 @@ U_BOOT_CMD( */ int check_block (struct nand_chip *nand, unsigned long pos) { - int retlen; + size_t retlen; uint8_t oob_data; uint16_t oob_data16[6]; int page0 = pos & (-nand->erasesize); @@ -423,9 +423,9 @@ int check_block (struct nand_chip *nand, unsigned long pos) return 1; } else { /* Note - bad block marker can be on first or second page */ - if (nand_read_oob(nand, page0 + badpos, 1, &retlen, &oob_data) + if (nand_read_oob(nand, page0 + badpos, 1, &retlen, (unsigned char *)&oob_data) || oob_data != 0xff - || nand_read_oob (nand, page1 + badpos, 1, &retlen, &oob_data) + || nand_read_oob (nand, page1 + badpos, 1, &retlen, (unsigned char *)&oob_data) || oob_data != 0xff) return 1; } @@ -501,11 +501,11 @@ int nand_rw (struct nand_chip* nand, int cmd, if (cmd & NANDRW_READ) { ret = nand_read_ecc(nand, start, min(len, eblk + erasesize - start), - &n, (u_char*)buf, eccbuf); + (size_t *)&n, (u_char*)buf, (u_char *)eccbuf); } else { ret = nand_write_ecc(nand, start, min(len, eblk + erasesize - start), - &n, (u_char*)buf, eccbuf); + (size_t *)&n, (u_char*)buf, (u_char *)eccbuf); } if (ret) @@ -1591,7 +1591,7 @@ int nand_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean) l = NAND_JFFS2_OOB16_FSDALEN; } - ret = nand_write_oob(nand, ofs + p, l, &n, + ret = nand_write_oob(nand, ofs + p, l, (size_t *)&n, (u_char *)&clean_marker); /* quit here if write failed */ if (ret) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 578b0ca9360..1babffec2e0 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -124,7 +124,7 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) for (nxt=j; env_get_char(nxt) != '\0'; ++nxt) ; - k = envmatch(name, j); + k = envmatch((uchar *)name, j); if (k < 0) { continue; } @@ -157,7 +157,7 @@ int _do_setenv (int flag, int argc, char *argv[]) int i, len, oldval; int console = -1; uchar *env, *nxt = NULL; - uchar *name; + char *name; bd_t *bd = gd->bd; uchar *env_data = env_get_addr(0); @@ -174,7 +174,7 @@ int _do_setenv (int flag, int argc, char *argv[]) for (env=env_data; *env; env=nxt+1) { for (nxt=env; *nxt; ++nxt) ; - if ((oldval = envmatch(name, env-env_data)) >= 0) + if ((oldval = envmatch((uchar *)name, env-env_data)) >= 0) break; } @@ -191,7 +191,7 @@ int _do_setenv (int flag, int argc, char *argv[]) if ( (strcmp (name, "serial#") == 0) || ((strcmp (name, "ethaddr") == 0) #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR) - && (strcmp (env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0) + && (strcmp ((char *)env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0) #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */ ) ) { printf ("Can't overwrite \"%s\"\n", name); @@ -483,7 +483,7 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * or NULL if not found */ -char *getenv (uchar *name) +char *getenv (char *name) { int i, nxt; @@ -497,15 +497,15 @@ char *getenv (uchar *name) return (NULL); } } - if ((val=envmatch(name, i)) < 0) + if ((val=envmatch((uchar *)name, i)) < 0) continue; - return (env_get_addr(val)); + return ((char *)env_get_addr(val)); } return (NULL); } -int getenv_r (uchar *name, uchar *buf, unsigned len) +int getenv_r (char *name, char *buf, unsigned len) { int i, nxt; @@ -517,7 +517,7 @@ int getenv_r (uchar *name, uchar *buf, unsigned len) return (-1); } } - if ((val=envmatch(name, i)) < 0) + if ((val=envmatch((uchar *)name, i)) < 0) continue; /* found; copy out */ n = 0; diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index 31f2ba2f696..62446d4efeb 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -2681,7 +2681,7 @@ static void print_fixed (volatile uchar *p) #define MAX_IDENT_FIELDS 4 static uchar *known_cards[] = { - "ARGOSY PnPIDE D5", + (uchar *)"ARGOSY PnPIDE D5", NULL }; @@ -2722,12 +2722,12 @@ static int identify (volatile uchar *p) else break; } - puts (id_str); + puts ((char *)id_str); putc ('\n'); for (card=known_cards; *card; ++card) { debug ("## Compare against \"%s\"\n", *card); - if (strcmp(*card, id_str) == 0) { /* found! */ + if (strcmp((char *)*card, (char *)id_str) == 0) { /* found! */ debug ("## CARD FOUND ##\n"); return (1); } diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index ec53790f813..e8048611f93 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -247,8 +247,8 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf("error reading partinfo\n"); return 1; } - if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) && - (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) { + if ((strncmp((char *)(info.type), BOOT_PART_TYPE, sizeof(info.type)) != 0) && + (strncmp((char *)(info.type), BOOT_PART_COMP, sizeof(info.type)) != 0)) { printf ("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n", info.type); @@ -277,7 +277,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) checksum = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; - if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) { + if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) { puts ("\n** Bad Header Checksum **\n"); return 1; } diff --git a/common/cmd_spi.c b/common/cmd_spi.c index 7b6faf79c5a..a6fdf7fddbd 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -119,7 +119,7 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf("Error with the SPI transaction.\n"); rcode = 1; } else { - cp = din; + cp = (char *)din; for(j = 0; j < ((bitlen + 7) / 8); j++) { printf("%02X", *cp++); } diff --git a/common/cmd_usb.c b/common/cmd_usb.c index 0738f553033..fdfd042acaa 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -362,15 +362,15 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (get_partition_info (stor_dev, part, &info)) { /* try to boot raw .... */ - strncpy(&info.type[0], BOOT_PART_TYPE, sizeof(BOOT_PART_TYPE)); - strncpy(&info.name[0], "Raw", 4); + strncpy((char *)&info.type[0], BOOT_PART_TYPE, sizeof(BOOT_PART_TYPE)); + strncpy((char *)&info.name[0], "Raw", 4); info.start=0; info.blksz=0x200; info.size=2880; printf("error reading partinfo...try to boot raw\n"); } - if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) && - (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) { + if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) && + (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) { printf ("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n", info.type); @@ -398,7 +398,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) checksum = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; - if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) { + if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) { puts ("\n** Bad Header Checksum **\n"); return 1; } diff --git a/common/env_common.c b/common/env_common.c index 9be4cc1dbf5..3201135ea2e 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -283,7 +283,7 @@ int env_complete(char *var, int maxv, char *cmdv[], int bufsz, char *buf) for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) ; - lval = env_get_addr(i); + lval = (char *)env_get_addr(i); rval = strchr(lval, '='); if (rval != NULL) { vallen = rval - lval; diff --git a/common/env_flash.c b/common/env_flash.c index d6257d07bd0..a2ea9c41406 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -202,7 +202,7 @@ int saveenv(void) debug (" %08lX ... %08lX ...", (ulong)&(flash_addr_new->data), sizeof(env_ptr->data)+(ulong)&(flash_addr_new->data)); - if ((rc = flash_write(env_ptr->data, + if ((rc = flash_write((char *)env_ptr->data, (ulong)&(flash_addr_new->data), sizeof(env_ptr->data))) || (rc = flash_write((char *)&(env_ptr->crc), @@ -291,7 +291,7 @@ int saveenv(void) ulong flash_offset; uchar env_buffer[CFG_ENV_SECT_SIZE]; #else - uchar *env_buffer = (char *)env_ptr; + uchar *env_buffer = (uchar *)env_ptr; #endif /* CFG_ENV_SECT_SIZE */ int rcode = 0; @@ -337,7 +337,7 @@ int saveenv(void) return 1; puts ("Writing to Flash... "); - rc = flash_write(env_buffer, flash_sect_addr, len); + rc = flash_write((char *)env_buffer, flash_sect_addr, len); if (rc != 0) { flash_perror (rc); rcode = 1; diff --git a/common/flash.c b/common/flash.c index b3084137a41..295fea2b83c 100644 --- a/common/flash.c +++ b/common/flash.c @@ -135,7 +135,7 @@ addr2info (ulong addr) * (only some targets require alignment) */ int -flash_write (uchar *src, ulong addr, ulong cnt) +flash_write (char *src, ulong addr, ulong cnt) { #ifdef CONFIG_SPD823TS return (ERR_TIMOUT); /* any other error codes are possible as well */ @@ -174,7 +174,7 @@ flash_write (uchar *src, ulong addr, ulong cnt) len = info->start[0] + info->size - addr; if (len > cnt) len = cnt; - if ((i = write_buff(info, src, addr, len)) != 0) { + if ((i = write_buff(info, (uchar *)src, addr, len)) != 0) { return (i); } cnt -= len; diff --git a/common/fpga.c b/common/fpga.c index c41c6f89a74..02d3e42b3bb 100644 --- a/common/fpga.c +++ b/common/fpga.c @@ -53,8 +53,8 @@ static int next_desc = FPGA_INVALID_DEVICE; static fpga_desc desc_table[CONFIG_MAX_FPGA_DEVICES]; /* Local static functions */ -static const fpga_desc * const fpga_get_desc( int devnum ); -static const fpga_desc * const fpga_validate( int devnum, void *buf, +static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_get_desc( int devnum ); +static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate( int devnum, void *buf, size_t bsize, char *fn ); static int fpga_dev_info( int devnum ); @@ -82,7 +82,7 @@ static void fpga_no_sup( char *fn, char *msg ) /* fpga_get_desc * map a device number to a descriptor */ -static const fpga_desc * const fpga_get_desc( int devnum ) +static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_get_desc( int devnum ) { fpga_desc *desc = (fpga_desc * )NULL; @@ -99,10 +99,10 @@ static const fpga_desc * const fpga_get_desc( int devnum ) /* fpga_validate * generic parameter checking code */ -static const fpga_desc * const fpga_validate( int devnum, void *buf, +static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate( int devnum, void *buf, size_t bsize, char *fn ) { - const fpga_desc * const desc = fpga_get_desc( devnum ); + fpga_desc * desc = fpga_get_desc( devnum ); if ( !desc ) { printf( "%s: Invalid device number %d\n", fn, devnum ); @@ -147,7 +147,7 @@ static int fpga_dev_info( int devnum ) printf( "Altera Device\nDescriptor @ 0x%p\n", desc ); ret_val = altera_info( desc->devdesc ); #else - fpga_no_sup( __FUNCTION__, "Altera devices" ); + fpga_no_sup( (char *)__FUNCTION__, "Altera devices" ); #endif break; default: @@ -185,7 +185,7 @@ int fpga_reloc( fpga_type devtype, void *desc, ulong reloc_off ) #if CONFIG_FPGA & CFG_FPGA_ALTERA ret_val = altera_reloc( desc, reloc_off ); #else - fpga_no_sup( __FUNCTION__, "Altera devices" ); + fpga_no_sup( (char *)__FUNCTION__, "Altera devices" ); #endif break; default: @@ -216,7 +216,7 @@ void fpga_init( ulong reloc_off ) /* fpga_count * Basic interface function to get the current number of devices available. */ -const int fpga_count( void ) +int fpga_count( void ) { return next_desc; } @@ -263,7 +263,7 @@ int fpga_add( fpga_type devtype, void *desc ) int fpga_load( int devnum, void *buf, size_t bsize ) { int ret_val = FPGA_FAIL; /* assume failure */ - const fpga_desc * const desc = fpga_validate( devnum, buf, bsize, __FUNCTION__ ); + fpga_desc * desc = fpga_validate( devnum, buf, bsize, (char *)__FUNCTION__ ); if ( desc ) { switch ( desc->devtype ) { @@ -278,7 +278,7 @@ int fpga_load( int devnum, void *buf, size_t bsize ) #if CONFIG_FPGA & CFG_FPGA_ALTERA ret_val = altera_load( desc->devdesc, buf, bsize ); #else - fpga_no_sup( __FUNCTION__, "Altera devices" ); + fpga_no_sup( (char *)__FUNCTION__, "Altera devices" ); #endif break; default: @@ -296,7 +296,7 @@ int fpga_load( int devnum, void *buf, size_t bsize ) int fpga_dump( int devnum, void *buf, size_t bsize ) { int ret_val = FPGA_FAIL; /* assume failure */ - const fpga_desc * const desc = fpga_validate( devnum, buf, bsize, __FUNCTION__ ); + fpga_desc * desc = fpga_validate( devnum, buf, bsize, (char *)__FUNCTION__ ); if ( desc ) { switch ( desc->devtype ) { @@ -311,7 +311,7 @@ int fpga_dump( int devnum, void *buf, size_t bsize ) #if CONFIG_FPGA & CFG_FPGA_ALTERA ret_val = altera_dump( desc->devdesc, buf, bsize ); #else - fpga_no_sup( __FUNCTION__, "Altera devices" ); + fpga_no_sup( (char *)__FUNCTION__, "Altera devices" ); #endif break; default: diff --git a/common/hush.c b/common/hush.c index c10b1176f65..bb5041a08d8 100644 --- a/common/hush.c +++ b/common/hush.c @@ -296,7 +296,7 @@ extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ #endif /* "globals" within this file */ -static char *ifs; +static uchar *ifs; static char map[256]; #ifndef __U_BOOT__ static int fake_mode; @@ -3134,8 +3134,8 @@ void mapset(const unsigned char *set, int code) void update_ifs_map(void) { /* char *ifs and char map[256] are both globals. */ - ifs = getenv("IFS"); - if (ifs == NULL) ifs=" \t\n"; + ifs = (uchar *)getenv("IFS"); + if (ifs == NULL) ifs=(uchar *)" \t\n"; /* Precompute a list of 'flow through' behavior so it can be treated * quickly up front. Computation is necessary because of IFS. * Special case handling of IFS == " \t\n" is not implemented. @@ -3144,11 +3144,11 @@ void update_ifs_map(void) */ memset(map,0,sizeof(map)); /* most characters flow through always */ #ifndef __U_BOOT__ - mapset("\\$'\"`", 3); /* never flow through */ - mapset("<>;&|(){}#", 1); /* flow through if quoted */ + mapset((uchar *)"\\$'\"`", 3); /* never flow through */ + mapset((uchar *)"<>;&|(){}#", 1); /* flow through if quoted */ #else - mapset("\\$'\"", 3); /* never flow through */ - mapset(";&|#", 1); /* flow through if quoted */ + mapset((uchar *)"\\$'\"", 3); /* never flow through */ + mapset((uchar *)";&|#", 1); /* flow through if quoted */ #endif mapset(ifs, 2); /* also flow through if quoted */ } @@ -3168,7 +3168,7 @@ int parse_stream_outer(struct in_str *inp, int flag) ctx.type = flag; initialize_context(&ctx); update_ifs_map(); - if (!(flag & FLAG_PARSE_SEMICOLON) || (flag & FLAG_REPARSING)) mapset(";$&|", 0); + if (!(flag & FLAG_PARSE_SEMICOLON) || (flag & FLAG_REPARSING)) mapset((uchar *)";$&|", 0); inp->promptmode=1; rcode = parse_stream(&temp, &ctx, inp, '\n'); #ifdef __U_BOOT__ diff --git a/common/kgdb.c b/common/kgdb.c index 06adb3ea514..6de6ec99a22 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -144,7 +144,7 @@ mem2hex(char *mem, char *buf, int count) } *buf = 0; longjmp_on_fault = 0; - return buf; + return (unsigned char *)buf; } /* convert the hex array pointed to by buf into binary to be placed in mem @@ -353,7 +353,7 @@ handle_exception (struct pt_regs *regs) *ptr++ = hexchars[rp->num >> 4]; *ptr++ = hexchars[rp->num & 0xf]; *ptr++ = ':'; - ptr = mem2hex((char *)&rp->val, ptr, 4); + ptr = (char *)mem2hex((char *)&rp->val, ptr, 4); *ptr++ = ';'; } @@ -364,7 +364,7 @@ handle_exception (struct pt_regs *regs) printf("kgdb: remcomOutBuffer: %s\n", remcomOutBuffer); #endif - putpacket(remcomOutBuffer); + putpacket((unsigned char *)&remcomOutBuffer); while (1) { volatile int errnum; @@ -508,7 +508,7 @@ handle_exception (struct pt_regs *regs) #endif /* reply to the request */ - putpacket(remcomOutBuffer); + putpacket((unsigned char *)&remcomOutBuffer); } /* while(1) */ } @@ -548,7 +548,7 @@ kgdb_output_string (const char* s, unsigned int count) buffer[0] = 'O'; mem2hex ((char *)s, &buffer[1], count); - putpacket(buffer); + putpacket((unsigned char *)&buffer); return 1; } diff --git a/common/lcd.c b/common/lcd.c index 7bf7a63fd7b..e64972fd813 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -279,9 +279,9 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) static inline void lcd_puts_xy (ushort x, ushort y, uchar *s) { #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO) - lcd_drawchars (x, y+BMP_LOGO_HEIGHT, s, strlen (s)); + lcd_drawchars (x, y+BMP_LOGO_HEIGHT, s, strlen ((char *)s)); #else - lcd_drawchars (x, y, s, strlen (s)); + lcd_drawchars (x, y, s, strlen ((char *)s)); #endif } @@ -526,7 +526,7 @@ void bitmap_plot (int x, int y) sizeof(bmp_logo_palette)/(sizeof(ushort))); bmap = &bmp_logo_bitmap[0]; - fb = (char *)(lcd_base + y * lcd_line_length + x); + fb = (uchar *)(lcd_base + y * lcd_line_length + x); if (NBITS(panel_info.vl_bpix) < 12) { /* Leave room for default color map */ @@ -710,15 +710,15 @@ static void *lcd_logo (void) #ifdef CONFIG_MPC823 # ifdef CONFIG_LCD_INFO sprintf (info, "%s (%s - %s) ", U_BOOT_VERSION, __DATE__, __TIME__); - lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, info, strlen(info)); + lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, (uchar *)info, strlen(info)); sprintf (info, "(C) 2004 DENX Software Engineering"); lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT, - info, strlen(info)); + (uchar *)info, strlen(info)); sprintf (info, " Wolfgang DENK, wd@denx.de"); lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT * 2, - info, strlen(info)); + (uchar *)info, strlen(info)); # ifdef CONFIG_LCD_INFO_BELOW_LOGO sprintf (info, "MPC823 CPU at %s MHz", strmhz(temp, gd->cpu_clk)); @@ -737,7 +737,7 @@ static void *lcd_logo (void) gd->ram_size >> 20, gd->bd->bi_flashsize >> 20 ); lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT * 4, - info, strlen(info)); + (uchar *)info, strlen(info)); # endif /* CONFIG_LCD_INFO_BELOW_LOGO */ # endif /* CONFIG_LCD_INFO */ diff --git a/common/main.c b/common/main.c index 1389958de3e..f042f3a636f 100644 --- a/common/main.c +++ b/common/main.c @@ -347,7 +347,7 @@ void main_loop (void) #ifdef CONFIG_MODEM_SUPPORT debug ("DEBUG: main_loop: do_mdm_init=%d\n", do_mdm_init); if (do_mdm_init) { - uchar *str = strdup(getenv("mdm_cmd")); + char *str = strdup(getenv("mdm_cmd")); setenv ("preboot", str); /* set or delete definition */ if (str != NULL) free (str); diff --git a/common/soft_i2c.c b/common/soft_i2c.c index f7ca49840a0..3d0e08c6ff3 100644 --- a/common/soft_i2c.c +++ b/common/soft_i2c.c @@ -399,7 +399,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) */ uchar i2c_reg_read(uchar i2c_addr, uchar reg) { - char buf; + uchar buf; i2c_read(i2c_addr, reg, 1, &buf, 1); diff --git a/common/usb_storage.c b/common/usb_storage.c index 69d195af605..99e4ab0d233 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -490,7 +490,7 @@ int usb_stor_BBB_comdat(ccb *srb, struct us_data *us) */ int usb_stor_CB_comdat(ccb *srb, struct us_data *us) { - int result; + int result = 0; int dir_in,retry; unsigned int pipe; unsigned long status; @@ -528,7 +528,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us) USB_STOR_PRINTF("CB_transport: control msg returned %d, direction is %s to go 0x%lx\n",result,dir_in ? "IN" : "OUT",srb->datalen); if (srb->datalen) { - result = us_one_transfer(us, pipe, srb->pdata,srb->datalen); + result = us_one_transfer(us, pipe, (char *)srb->pdata,srb->datalen); USB_STOR_PRINTF("CBI attempted to transfer data, result is %d status %lX, len %d\n", result,us->pusb_dev->status,us->pusb_dev->act_len); if(!(us->pusb_dev->status & USB_ST_NAK_REC)) break; @@ -847,7 +847,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss) { char *ptr; - ptr=srb->pdata; + ptr=(char *)srb->pdata; memset(&srb->cmd[0],0,12); srb->cmd[0]=SCSI_REQ_SENSE; srb->cmd[1]=srb->lun<<5; @@ -857,7 +857,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss) srb->cmdlen=12; ss->transport(srb,ss); USB_STOR_PRINTF("Request Sense returned %02X %02X %02X\n",srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]); - srb->pdata=ptr; + srb->pdata=(uchar *)ptr; return 0; } diff --git a/common/xilinx.c b/common/xilinx.c index 40ce3bcbbf0..e03e78cb285 100644 --- a/common/xilinx.c +++ b/common/xilinx.c @@ -54,7 +54,7 @@ int xilinx_load (Xilinx_desc * desc, void *buf, size_t bsize) { int ret_val = FPGA_FAIL; /* assume a failure */ - if (!xilinx_validate (desc, __FUNCTION__)) { + if (!xilinx_validate (desc, (char *)__FUNCTION__)) { printf ("%s: Invalid device descriptor\n", __FUNCTION__); } else switch (desc->family) { @@ -101,7 +101,7 @@ int xilinx_dump (Xilinx_desc * desc, void *buf, size_t bsize) { int ret_val = FPGA_FAIL; /* assume a failure */ - if (!xilinx_validate (desc, __FUNCTION__)) { + if (!xilinx_validate (desc, (char *)__FUNCTION__)) { printf ("%s: Invalid device descriptor\n", __FUNCTION__); } else switch (desc->family) { @@ -148,7 +148,7 @@ int xilinx_info (Xilinx_desc * desc) { int ret_val = FPGA_FAIL; - if (xilinx_validate (desc, __FUNCTION__)) { + if (xilinx_validate (desc, (char *)__FUNCTION__)) { printf ("Family: \t"); switch (desc->family) { case Xilinx_Spartan2: @@ -244,7 +244,7 @@ int xilinx_reloc (Xilinx_desc * desc, ulong reloc_offset) { int ret_val = FPGA_FAIL; /* assume a failure */ - if (!xilinx_validate (desc, __FUNCTION__)) { + if (!xilinx_validate (desc, (char *)__FUNCTION__)) { printf ("%s: Invalid device descriptor\n", __FUNCTION__); } else switch (desc->family) { |