From: Seung-Woo Kim Date: Wed, 3 Jan 2018 02:32:35 +0000 (+0900) Subject: bootmode: tizen: remove build warnings and static analysis tool warnings X-Git-Tag: accepted/tizen/5.0/unified/20181106.201708~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F165631%2F4;p=profile%2Fmobile%2Fplatform%2Fkernel%2Fu-boot-tm1.git bootmode: tizen: remove build warnings and static analysis tool warnings Remove build warnings and static analysis tool warnings. Change-Id: I6422c6147ba979b6ae8340e2ffd229dd2cf47ffe Signed-off-by: Seung-Woo Kim --- diff --git a/property/tizen_misc.c b/property/tizen_misc.c index 263c476..37c9994 100644 --- a/property/tizen_misc.c +++ b/property/tizen_misc.c @@ -13,9 +13,19 @@ #include #include +#ifdef CONFIG_TIZEN_LPM_SUPPORT +extern int charger_connected(void); +#endif +extern unsigned char *get_global_cid(void); +extern int get_volumn_down_status2(void); +extern unsigned char _chkNVEcc(uint8_t * buf, uint32_t size, uint32_t checksum); +extern unsigned short calc_checksum(unsigned char *dat, unsigned long len); + static void convert_to_string(wchar_t *crap, char *buf) { - while (*buf++ = (char)*crap++); + while (*crap) + *buf++ = (char)*crap++; + *buf = '\0'; } int tizen_get_partition_info_by_name (block_dev_desc_t *dev_desc, @@ -58,48 +68,50 @@ int thor_save_env(char *str) #ifndef CONFIG_TIZEN_LPM_SUPPORT return ret; -#endif - ret = Emmc_Write(PARTITION_USER, part_info.start, 1, str); +#else + ret = Emmc_Write(PARTITION_USER, part_info.start, 1, (uint8 *)str); return ret; +#endif } -char *thor_get_env(void) +static int thor_get_env(char *str) { block_dev_desc_t *p_block_dev; disk_partition_t part_info; - char str[EMMC_SECTOR_SIZE]; int ret; p_block_dev = get_dev("mmc", CONFIG_MMC_DEFAULT_DEV); if (!p_block_dev) - return NULL; + return -1; ret = tizen_get_partition_info_by_name(p_block_dev, L"param", &part_info); if (ret < 0) - return NULL; + return ret; - ret = Emmc_Read(PARTITION_USER, part_info.start, 1, str); - if (ret <0) - return NULL; + ret = Emmc_Read(PARTITION_USER, part_info.start, 1, (uint8 *)str); + if (!ret) + return -1; - return str; + return 0; } enum tizen_pm_state check_pm_status(void) { enum tizen_pm_state state = PM_STATE_NORMAL; - char *str = thor_get_env(); + char str[EMMC_SECTOR_SIZE]; + int ret; -#ifndef CONFIG_TIZEN_LPM_SUPPORT - return PM_STATE_NORMAL; -#endif + ret = thor_get_env(str); - if (str) { + if (!ret) { if (!strncmp(str, "thor", strlen("thor"))) - return PM_STATE_NORMAL; + return state; } +#ifndef CONFIG_TIZEN_LPM_SUPPORT + return state; +#else if (charger_connected()) { int adp_type = sprdchg_charger_is_adapter(); @@ -113,6 +125,7 @@ enum tizen_pm_state check_pm_status(void) } return state; +#endif } unsigned int tizen_get_part_num(const char *part_name) @@ -175,13 +188,25 @@ unsigned int tizen_get_part_info(const char *name, struct thor_part_info *info) unsigned int thor_get_part_info(struct thor_part_info *part_info, const char *name) { int i; - const char *file_name = strtok(name, "."); + char *orig_name, *file_name; + + orig_name = strdup(name); + if (!orig_name) + return -1; + + file_name = strtok(orig_name, "."); + if (!file_name) + goto out; for (i = 0; i < ARRAY_SIZE(thor_part_map); i++) { - if (!strcmp(file_name, thor_part_map[i].file_name)) + if (!strcmp(file_name, thor_part_map[i].file_name)) { + free(orig_name); return tizen_get_part_info(thor_part_map[i].part_name, part_info); + } } +out: + free(orig_name); return -1; } @@ -203,7 +228,6 @@ unsigned int tizen_board_key_scan(void) unsigned int s_int_status = REG_KPD_INT_RAW_STATUS; unsigned int s_key_status = REG_KPD_KEY_STATUS; unsigned int scan_code = 0; - unsigned int key_code = 0; if(s_key_status &KPD1_KEY_STS) scan_code = (uint32_t)(s_key_status & (KPD1_KEY_STS | KPD1_ROW_CNT | KPD1_COL_CNT)); @@ -254,7 +278,7 @@ boot_mode_enum_type tizen_check_keypad(void) typedef struct _NV_Update{ uint32 nv_id; - void (*update)(); + void (*update)(void); } NV_Update_T; typedef enum _NV_UPDATE_ERR_E @@ -299,13 +323,13 @@ int runtimenv_read_with_backup(void) char header[SECTOR_SIZE]; unsigned int checksum = 0; nv_header_t * header_p = NULL; - unsigned int runtimenv_adr; + void *runtimenv_adr; int ret; block_dev_desc_t *p_block_dev; disk_partition_t part_info; - runtimenv_adr = WRUNTIMENV_ADR; + runtimenv_adr = (void *)WRUNTIMENV_ADR; p_block_dev = get_dev("mmc", CONFIG_MMC_DEFAULT_DEV); if (!p_block_dev) @@ -334,28 +358,37 @@ int runtimenv_read_with_backup(void) } //mmc_bread((u8 *)oribuf, base_sector, RUNTIMENV_SIZE); - ret = Emmc_Read(PARTITION_USER, part_info.start, RUNTIMENV_SIZE / SECTOR_SIZE, oribuf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, RUNTIMENV_SIZE / SECTOR_SIZE, (uint8 *)oribuf); + if (!ret) { + free(bakbuf); + free(oribuf); return -1; + } memset(header, 0, SECTOR_SIZE); memcpy(header, oribuf, SECTOR_SIZE); checksum = header_p->checksum; printf("runtimenv_read_with_backup origin checksum 0x%x\n", checksum); - if (_chkNVEcc(oribuf + SECTOR_SIZE, RUNTIMENV_SIZE, checksum)) { + if (_chkNVEcc((uint8_t *)oribuf + SECTOR_SIZE, RUNTIMENV_SIZE, checksum)) { memcpy(runtimenv_adr,oribuf+SECTOR_SIZE,RUNTIMENV_SIZE); status += 1; } ret = tizen_get_partition_info_by_name(p_block_dev, L"runtimenv2", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); return -1; + } //mmc_bread((u8 *)bakbuf, base_sector, RUNTIMENV_SIZE); - ret = Emmc_Read(PARTITION_USER, part_info.start, RUNTIMENV_SIZE / SECTOR_SIZE, bakbuf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, RUNTIMENV_SIZE / SECTOR_SIZE, (uint8 *)bakbuf); + if (!ret) { + free(bakbuf); + free(oribuf); return -1; + } memset(header, 0, SECTOR_SIZE); memcpy(header, bakbuf, SECTOR_SIZE); @@ -363,7 +396,7 @@ int runtimenv_read_with_backup(void) checksum = header_p->checksum; printf("runtime_read_with_backup backup checksum 0x%x\n", checksum); - if(_chkNVEcc(bakbuf + SECTOR_SIZE, RUNTIMENV_SIZE, checksum)) { + if(_chkNVEcc((uint8_t *)bakbuf + SECTOR_SIZE, RUNTIMENV_SIZE, checksum)) { memcpy(runtimenv_adr,bakbuf+SECTOR_SIZE,RUNTIMENV_SIZE); status += 1 << 1; } @@ -377,17 +410,20 @@ int runtimenv_read_with_backup(void) case 1: printf("bak partition is damaged!\n"); // mmc_bwrite((u8 *)oribuf, base_sector, (RUNTIMENV_SIZE+SECTOR_SIZE)); - Emmc_Write(PARTITION_USER, part_info.start, (RUNTIMENV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, oribuf); + Emmc_Write(PARTITION_USER, part_info.start, (RUNTIMENV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, (uint8 *)oribuf); break; case 2: printf("org partition is damaged!\n!"); memcpy(runtimenv_adr, bakbuf + SECTOR_SIZE, RUNTIMENV_SIZE); ret = tizen_get_partition_info_by_name(p_block_dev, L"runtimenv1", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); return -1; + } - Emmc_Write(PARTITION_USER, part_info.start, (RUNTIMENV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, bakbuf); + Emmc_Write(PARTITION_USER, part_info.start, (RUNTIMENV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, (uint8 *)bakbuf); break; case 3: printf("both org and bak partition are ok!\n"); @@ -402,7 +438,7 @@ int runtimenv_read_with_backup(void) int fixnv_read_with_backup(void) { - unsigned int fixnv_adr = WFIXNV_ADR; + void *fixnv_adr = (void *)WFIXNV_ADR; nv_header_t * header_p = NULL; nv_header_t *tmp_header_p = NULL; unsigned char status = 0; @@ -432,8 +468,8 @@ int fixnv_read_with_backup(void) memset(tmp_header, 0, SECTOR_SIZE); // mmc_bread((u8 *)tmpbuf, ppi->blkstart, FIXNV_SIZE+SECTOR_SIZE); - ret = Emmc_Read(PARTITION_USER, part_info.start, (FIXNV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, tmpbuf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, (FIXNV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, (uint8 *)tmpbuf); + if (!ret) return -1; memcpy(tmp_header, tmpbuf, SECTOR_SIZE); @@ -441,7 +477,7 @@ int fixnv_read_with_backup(void) if (tmp_header_p->magic != NV_HEAD_MAGIC) { tmp_header_p->magic = NV_HEAD_MAGIC; tmp_header_p->len = FIXNV_SIZE; - tmp_header_p->checksum = (unsigned long)calc_checksum(tmpbuf, FIXNV_SIZE); + tmp_header_p->checksum = (unsigned long)calc_checksum((unsigned char *)tmpbuf, FIXNV_SIZE); tmp_header_p->version = NV_VERSION; tmp_header_p->updated = NV_UPDATED; @@ -449,8 +485,8 @@ int fixnv_read_with_backup(void) // mmc_bwrite(tmp_header,ppi->blkstart,SECTOR_SIZE); // mmc_bwrite(tmpbuf,ppi->blkstart+1,FIXNV_SIZE); - Emmc_Write(PARTITION_USER, part_info.start, 1, tmp_header); - Emmc_Write(PARTITION_USER, part_info.start + 1, FIXNV_SIZE / SECTOR_SIZE, tmpbuf); + Emmc_Write(PARTITION_USER, part_info.start, 1, (uint8 *)tmp_header); + Emmc_Write(PARTITION_USER, part_info.start + 1, FIXNV_SIZE / SECTOR_SIZE, (uint8 *)tmpbuf); } free(tmpbuf); @@ -475,19 +511,22 @@ int fixnv_read_with_backup(void) return -1; } - printf("loading fixnv1 from %x(%x) to %x\n", part_info.start, FIXNV_SIZE, fixnv_adr); + printf("loading fixnv1 from %lx(%x) to %lx\n", part_info.start, FIXNV_SIZE, (unsigned long)fixnv_adr); //mmc_bread((u8 *)oribuf, base_sector, FIXNV_SIZE); - ret = Emmc_Read(PARTITION_USER, part_info.start, FIXNV_SIZE / SECTOR_SIZE, oribuf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, FIXNV_SIZE / SECTOR_SIZE, (uint8 *)oribuf); + if (!ret) { + free(bakbuf); + free(oribuf); return -1; + } memset(header, 0, SECTOR_SIZE); memcpy(header, oribuf, SECTOR_SIZE); checksum = header_p->checksum; printf("nv_read_with_backup origin checksum 0x%x\n", checksum); - if (_chkNVEcc(oribuf + SECTOR_SIZE, FIXNV_SIZE, checksum)) { + if (_chkNVEcc((uint8_t *)oribuf + SECTOR_SIZE, FIXNV_SIZE, checksum)) { memcpy(fixnv_adr, oribuf + SECTOR_SIZE, FIXNV_SIZE); status += 1; } @@ -498,13 +537,16 @@ int fixnv_read_with_backup(void) status = 0; ret = tizen_get_partition_info_by_name(p_block_dev, L"fixnv2", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); return -1; + } - printf("loading fixnv2 from %x(%x) to %x\n", part_info.start, FIXNV_SIZE, fixnv_adr); + printf("loading fixnv2 from %lx(%x) to %lx\n", part_info.start, FIXNV_SIZE, (unsigned long)fixnv_adr); //mmc_bread((u8 *)bakbuf, base_sector, FIXNV_SIZE); - ret = Emmc_Read(PARTITION_USER, part_info.start, FIXNV_SIZE / SECTOR_SIZE, bakbuf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, FIXNV_SIZE / SECTOR_SIZE, (uint8 *)bakbuf); + if (!ret) return -1; memset(header, 0, SECTOR_SIZE); @@ -515,7 +557,9 @@ int fixnv_read_with_backup(void) printf("nv1_magic: %x, NV_HEAD_MAGIC: %x\n", nv_magic, NV_HEAD_MAGIC); if ((nv_updated == NV_UPDATED) && (nv_magic == NV_HEAD_MAGIC)) { - unsigned int nv_backup_status; +#if NV_BACKUP + unsigned int nv_backup_status = ERR_FIXNV_NONE; +#endif char *bakbuf_update = NULL; char *oribuf_update = NULL; @@ -545,6 +589,8 @@ int fixnv_read_with_backup(void) memset(bakbuf_update, 0xff, FIXNV_SIZE); memcpy(bakbuf_update, bakbuf + SECTOR_SIZE, FIXNV_SIZE); + +#if NV_BACKUP /* TODO */ // nv_backup_status = modem_update_fixnv_image(bakbuf_update, oribuf_update); printf("nv_backup_status = %d \n", nv_backup_status); @@ -555,34 +601,46 @@ int fixnv_read_with_backup(void) case ERR_FIXNV_INITCPY: case ERR_FIXNV_UPDATE_CPY: printf("nv update is succeeded.\n"); +#endif header_p = (nv_header_t *)header; header_p->magic = NV_HEAD_MAGIC; header_p->len = FIXNV_SIZE; - header_p->checksum = (unsigned long)calc_checksum(oribuf_update,FIXNV_SIZE); + header_p->checksum = (unsigned long)calc_checksum((unsigned char *)oribuf_update,FIXNV_SIZE); header_p->version = NV_VERSION; header_p->updated = 0x0; ret = tizen_get_partition_info_by_name(p_block_dev, L"fixnv1", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); + free(bakbuf_update); + free(oribuf_update); return -1; + } //mmc_bwrite(header, ppi->blkstart, SECTOR_SIZE); //mmc_bwrite(oribuf_update, (ppi->blkstart+1), FIXNV_SIZE); - Emmc_Write(PARTITION_USER, part_info.start, 1, header); - Emmc_Write(PARTITION_USER, part_info.start + 1, FIXNV_SIZE / SECTOR_SIZE, oribuf_update); + Emmc_Write(PARTITION_USER, part_info.start, 1, (uint8 *)header); + Emmc_Write(PARTITION_USER, part_info.start + 1, FIXNV_SIZE / SECTOR_SIZE, (uint8 *)oribuf_update); ret = tizen_get_partition_info_by_name(p_block_dev, L"fixnv2", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); + free(bakbuf_update); + free(oribuf_update); return -1; + } //mmc_bwrite(header, ppi->blkstart, SECTOR_SIZE); //mmc_bwrite(oribuf_update, (ppi->blkstart+1), FIXNV_SIZE); - Emmc_Write(PARTITION_USER, part_info.start, 1, header); - Emmc_Write(PARTITION_USER, part_info.start + 1, FIXNV_SIZE / SECTOR_SIZE, oribuf_update); + Emmc_Write(PARTITION_USER, part_info.start, 1, (uint8 *)header); + Emmc_Write(PARTITION_USER, part_info.start + 1, FIXNV_SIZE / SECTOR_SIZE, (uint8 *)oribuf_update); memset(fixnv_adr, 0xff, FIXNV_SIZE); memcpy(fixnv_adr, oribuf_update, FIXNV_SIZE); +#if NV_BACKUP break; default: printf("nv update is failed. Original NV will be NV partitions.\n"); @@ -590,24 +648,30 @@ int fixnv_read_with_backup(void) header_p->updated = 0x1; ret = tizen_get_partition_info_by_name(p_block_dev, L"fixnv2", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); + free(bakbuf_update); + free(oribuf_update); return -1; + } //mmc_bwrite(header, ppi->blkstart, SECTOR_SIZE); - Emmc_Write(PARTITION_USER, part_info.start, 1, header); + Emmc_Write(PARTITION_USER, part_info.start, 1, (uint8 *)header); memcpy(fixnv_adr, oribuf_update, FIXNV_SIZE); } +#endif free(bakbuf_update); free(oribuf_update); } else { checksum = header_p->checksum; - printf("nv_read_with_backup backup checksum 0x%x\n", checksum); - if (_chkNVEcc(bakbuf + SECTOR_SIZE, FIXNV_SIZE, checksum)) { - memcpy(fixnv_adr, bakbuf + SECTOR_SIZE,FIXNV_SIZE); - status += 1<<1; - } + printf("nv_read_with_backup backup checksum 0x%x\n", checksum); + if (_chkNVEcc((uint8_t *)bakbuf + SECTOR_SIZE, FIXNV_SIZE, checksum)) { + memcpy(fixnv_adr, bakbuf + SECTOR_SIZE,FIXNV_SIZE); + status += 1<<1; + } - switch(status) { + switch(status) { case 0: printf("both org and bak partition are damaged!\n"); free(bakbuf); @@ -616,7 +680,7 @@ int fixnv_read_with_backup(void) case 1: printf("bak partition is damaged!\n"); //mmc_bwrite((u8 *)oribuf, base_sector, (FIXNV_SIZE+SECTOR_SIZE)); - Emmc_Write(PARTITION_USER, part_info.start, (FIXNV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, oribuf); + Emmc_Write(PARTITION_USER, part_info.start, (FIXNV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, (uint8 *)oribuf); break; case 2: @@ -624,19 +688,22 @@ int fixnv_read_with_backup(void) memcpy(fixnv_adr, bakbuf+SECTOR_SIZE, FIXNV_SIZE); ret = tizen_get_partition_info_by_name(p_block_dev, L"fixnv1", &part_info); - if (ret < 0) + if (ret < 0) { + free(bakbuf); + free(oribuf); return -1; + } //mmc_bwrite((u8 *)bakbuf, base_sector, (FIXNV_SIZE+SECTOR_SIZE)); - Emmc_Write(PARTITION_USER, part_info.start, (FIXNV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, bakbuf); + Emmc_Write(PARTITION_USER, part_info.start, (FIXNV_SIZE + SECTOR_SIZE) / SECTOR_SIZE, (uint8 *)bakbuf); break; case 3: printf("both org and bak partition are ok!\n"); break; - } + } } free(bakbuf); - free(oribuf); + free(oribuf); return 0; } @@ -660,18 +727,19 @@ int load_modem_data(void) block_dev_desc_t *p_block_dev; disk_partition_t part_info; int ret = 0; +#if BIN_SIZE_LEFT u32 left; +#endif u32 nsct; - char *sctbuf = NULL; - unsigned char *buf = WMODEM_ADR; + unsigned char *buf = (void *)WMODEM_ADR; - if(!buf) - return -1; - - printf("load modem to addr 0x%08x\n", buf); + printf("load modem to addr 0x%08lx\n", (unsigned long)buf); nsct = WMODEM_SIZE / EMMC_SECTOR_SIZE; +#if BIN_SIZE_LEFT + /* size of the image is multiple of emmc sector size, so no need to check it */ left = WMODEM_SIZE % EMMC_SECTOR_SIZE; +#endif p_block_dev = get_dev("mmc", CONFIG_MMC_DEFAULT_DEV); if (!p_block_dev) @@ -681,20 +749,22 @@ int load_modem_data(void) if (ret < 0) return -1; - ret = Emmc_Read(PARTITION_USER, part_info.start, nsct, buf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, nsct, (uint8 *)buf); + if (!ret) return -1; +#if BIN_SIZE_LEFT if (left) { - sctbuf = malloc(EMMC_SECTOR_SIZE); + char *sctbuf = sctbuf = malloc(EMMC_SECTOR_SIZE); if (!sctbuf) return -1; - ret = Emmc_Read(PARTITION_USER, part_info.start + nsct, 1, sctbuf); + ret = Emmc_Read(PARTITION_USER, part_info.start + nsct, 1, (uint8 *)sctbuf); if (ret) memcpy(buf + (nsct * EMMC_SECTOR_SIZE), sctbuf, left); free(sctbuf); } +#endif printf("partition; modem read success!\n"); @@ -706,18 +776,19 @@ int load_dsp_data(void) block_dev_desc_t *p_block_dev; disk_partition_t part_info; int ret = 0; +#if BIN_SIZE_LEFT u32 left; +#endif u32 nsct; - char *sctbuf = NULL; - unsigned char *buf = WDSP_ADR; - - if(!buf) - return -1; + unsigned char *buf = (void *)WDSP_ADR; - printf("load dsp to addr 0x%08x\n", buf); + printf("load dsp to addr 0x%08lx\n", (unsigned long)buf); nsct = WDSP_SIZE / EMMC_SECTOR_SIZE; +#if BIN_SIZE_LEFT + /* size of the image is multiple of emmc sector size, so no need to check it */ left = WDSP_SIZE % EMMC_SECTOR_SIZE; +#endif p_block_dev = get_dev("mmc", CONFIG_MMC_DEFAULT_DEV); if (!p_block_dev) @@ -727,20 +798,22 @@ int load_dsp_data(void) if (ret < 0) return -1; - ret = Emmc_Read(PARTITION_USER, part_info.start, nsct, buf); - if (ret < 0) + ret = Emmc_Read(PARTITION_USER, part_info.start, nsct, (uint8 *)buf); + if (!ret) return -1; +#if BIN_SIZE_LEFT if (left) { - sctbuf = malloc(EMMC_SECTOR_SIZE); + char *sctbuf = malloc(EMMC_SECTOR_SIZE); if (!sctbuf) return -1; - ret = Emmc_Read(PARTITION_USER, part_info.start + nsct, 1, sctbuf); + ret = Emmc_Read(PARTITION_USER, part_info.start + nsct, 1, (uint8 *)sctbuf); if (ret) memcpy(buf + (nsct * EMMC_SECTOR_SIZE), sctbuf, left); free(sctbuf); } +#endif printf("partition; dsp read success!\n"); @@ -768,9 +841,9 @@ static int load_binary_to_addr(char *name, unsigned int addr, unsigned int size) if (ret < 0) return ret; - ret = Emmc_Read(PARTITION_USER, info.offset, size / info.blksz, addr); - if (ret < 0) - return ret; + ret = Emmc_Read(PARTITION_USER, info.offset, size / info.blksz, (uint8 *)addr); + if (!ret) + return -1; return 0; } @@ -792,11 +865,11 @@ int check_board_signature(char *fname, unsigned int dn_addr, unsigned int size) return 0; /* can't found signature in target - download continue */ - ret = load_binary_to_addr(PARTS_BOOT, bl_buf, CONFIG_SIG_IMAGE_SIZE); + ret = load_binary_to_addr(PARTS_BOOT, (unsigned int)(unsigned long)bl_buf, CONFIG_SIG_IMAGE_SIZE); if (ret < 0) return 0; - ret = get_image_signature(&bh_target, bl_buf, CONFIG_SIG_IMAGE_SIZE); + ret = get_image_signature(&bh_target, (unsigned int)(unsigned long)bl_buf, CONFIG_SIG_IMAGE_SIZE); if (ret) return 0;