fix: 修复fs在iccarm下的编译错误

close: #I5NXFL

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
This commit is contained in:
arvinzzz 2022-08-24 16:59:42 +08:00
parent 8a25f31aa4
commit 5756d45e84
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;
}
}