!812 fix:iccarm下fs的编译错误

Merge pull request !812 from Zhaotianyu/20220824iccarm_fs_fix
This commit is contained in:
openharmony_ci 2022-08-24 10:49:19 +00:00 committed by Gitee
commit f5f18ca669
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ static uint32_t LfsGetStartAddr(int partition)
return INVALID_DEVICE_ADDR;
}
return g_lfsDevice->dAddrArray[partition];
return (uint32_t)g_lfsDevice->dAddrArray[partition];
}
WEAK int littlefs_block_read(const struct lfs_config *c, lfs_block_t block,
@ -663,7 +663,7 @@ int LfsFormat(const char *partName, void *privData)
ret = lfs_format(&lfs, &g_lfsCfg);
if (ret != 0) {
errno = LittlefsErrno(ret);
ret = LOS_NOK;
ret = (int)LOS_NOK;
}
return ret;
}

View File

@ -81,19 +81,19 @@ static int AddDevice(const char *dev, const char *fsType, int *lengthArray, int
for (prev = g_deviceList; prev != NULL; prev = prev->dNext) {
if (strcmp(prev->dDev, dev) == 0) {
errno = -EEXIST;
return LOS_NOK;
return (int)LOS_NOK;
}
}
if (addrArray == NULL) {
errno = -EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
prev = (struct DeviceDesc *)malloc(sizeof(struct DeviceDesc));
if (prev == NULL) {
errno = -ENOMEM;
return LOS_NOK;
return (int)LOS_NOK;
}
prev->dDev = strdup(dev);
prev->dFsType = strdup(fsType);
@ -131,7 +131,7 @@ errout:
free(prev);
errno = -ENOMEM;
return LOS_NOK;
return (int)LOS_NOK;
}
@ -143,7 +143,7 @@ int LOS_DiskPartition(const char *dev, const char *fsType, int *lengthArray, int
if ((fMap != NULL) && (fMap->fsMgt != NULL) &&
(fMap->fsMgt->fdisk != NULL)) {
ret = fMap->fsMgt->fdisk(dev, lengthArray, partNum);
if (ret == LOS_NOK) {
if (ret == (int)LOS_NOK) {
return ret;
}
}