diff --git a/components/fs/littlefs/lfs_adapter.c b/components/fs/littlefs/lfs_adapter.c index 1e80f672..1a55831d 100644 --- a/components/fs/littlefs/lfs_adapter.c +++ b/components/fs/littlefs/lfs_adapter.c @@ -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; } diff --git a/components/fs/vfs/vfs_partition.c b/components/fs/vfs/vfs_partition.c index f86a27f9..28acfb80 100644 --- a/components/fs/vfs/vfs_partition.c +++ b/components/fs/vfs/vfs_partition.c @@ -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; } }