From 672bc729a6a8c266ee8f891a214a27d50b73185e Mon Sep 17 00:00:00 2001 From: yinjiaming Date: Thu, 3 Mar 2022 07:38:58 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BB=E5=B9=B2=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B8=85=E7=90=86=20=E3=80=90=E8=83=8C=E6=99=AF=E3=80=91=20?= =?UTF-8?q?=E4=B8=BB=E5=B9=B2=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 在需要的地方添加了强制类型转换 【影响】 对现有的产品编译不会有影响。 Signed-off-by: yinjiaming Change-Id: Id6693137310d8c2e63f4e5489564d7c01c016a18 --- arch/arm/arm/src/strncpy_from_user.c | 2 +- fs/vfs/operation/vfs_fallocate64.c | 2 +- kernel/extended/liteipc/hm_liteipc.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/arm/src/strncpy_from_user.c b/arch/arm/arm/src/strncpy_from_user.c index 70c98bc9..0e400ce3 100644 --- a/arch/arm/arm/src/strncpy_from_user.c +++ b/arch/arm/arm/src/strncpy_from_user.c @@ -46,7 +46,7 @@ INT32 LOS_StrncpyFromUser(CHAR *dst, const CHAR *src, INT32 count) } maxCount = (LOS_IsUserAddressRange((VADDR_T)(UINTPTR)src, (size_t)count)) ? \ - count : (USER_ASPACE_TOP_MAX - (UINTPTR)src); + count : (INT32)(USER_ASPACE_TOP_MAX - (UINTPTR)src); for (i = 0; i < maxCount; ++i) { if (LOS_GetUser(&character, src + offset) != LOS_OK) { diff --git a/fs/vfs/operation/vfs_fallocate64.c b/fs/vfs/operation/vfs_fallocate64.c index bd56f5f9..07c44b55 100644 --- a/fs/vfs/operation/vfs_fallocate64.c +++ b/fs/vfs/operation/vfs_fallocate64.c @@ -133,7 +133,7 @@ int fallocate64(int fd, int mode, off64_t offset, off64_t len) return VFS_ERROR; } - if (filep->f_oflags & O_DIRECTORY) { + if ((unsigned int)filep->f_oflags & O_DIRECTORY) { set_errno(EBADF); return VFS_ERROR; } diff --git a/kernel/extended/liteipc/hm_liteipc.c b/kernel/extended/liteipc/hm_liteipc.c index fe061eb3..2c0b7367 100644 --- a/kernel/extended/liteipc/hm_liteipc.c +++ b/kernel/extended/liteipc/hm_liteipc.c @@ -1306,15 +1306,15 @@ LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg switch (cmd) { case IPC_SET_CMS: - return SetCms(arg); + return (INT32)SetCms(arg); case IPC_CMS_CMD: - return HandleCmsCmd((CmsCmdContent *)(UINTPTR)arg); + return (INT32)HandleCmsCmd((CmsCmdContent *)(UINTPTR)arg); case IPC_SET_IPC_THREAD: if (IsCmsSet() == FALSE) { PRINT_ERR("Liteipc ServiceManager not set!\n"); return -EINVAL; } - return SetIpcTask(); + return (INT32)SetIpcTask(); case IPC_SEND_RECV_MSG: if (arg == 0) { return -EINVAL; @@ -1325,12 +1325,12 @@ LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg } ret = LiteIpcMsgHandle((IpcContent *)(UINTPTR)arg); if (ret != LOS_OK) { - return ret; + return (INT32)ret; } break; default: PRINT_ERR("Unknow liteipc ioctl cmd:%d\n", cmd); return -EINVAL; } - return ret; + return (INT32)ret; } -- GitLab