refactor: fix codecheck
Signed-off-by: arvinzzz <zhaotianyu9@huawei.com> Change-Id: Ib35ca40dc837d78a4c9dc03e44d117088865a5a6
This commit is contained in:
parent
5de241eb2a
commit
145ff76ab6
|
@ -490,14 +490,14 @@ off_t VfsJffs2Seek(struct file *filep, off_t offset, int whence)
|
|||
filePos = filep->f_pos;
|
||||
|
||||
switch (whence) {
|
||||
case SEEK_SET:
|
||||
filePos = offset;
|
||||
break;
|
||||
|
||||
case SEEK_CUR:
|
||||
filePos += offset;
|
||||
break;
|
||||
|
||||
case SEEK_SET:
|
||||
filePos = offset;
|
||||
break;
|
||||
|
||||
case SEEK_END:
|
||||
filePos = node->i_size + offset;
|
||||
break;
|
||||
|
|
|
@ -485,29 +485,35 @@ UINT32 OsDevLimitWriteDeny(ProcLimitSet *plimit, const CHAR *buf, UINT32 size)
|
|||
return DevLimitUpdateAccess(plimit, buf, DEVLIMIT_DENY);
|
||||
}
|
||||
|
||||
STATIC VOID DevLimitItemSetAccess(CHAR *acc, INT16 access)
|
||||
STATIC VOID DevLimitItemSetAccess(CHAR *accArray, INT16 access)
|
||||
{
|
||||
INT32 index = 0;
|
||||
(VOID)memset_s(acc, ACCLEN, 0, ACCLEN);
|
||||
if (access & DEVLIMIT_ACC_READ) {
|
||||
acc[index++] = 'r';
|
||||
accArray[index] = 'r';
|
||||
index++;
|
||||
}
|
||||
if (access & DEVLIMIT_ACC_WRITE) {
|
||||
acc[index++] = 'w';
|
||||
accArray[index] = 'w';
|
||||
index++;
|
||||
}
|
||||
if (access & DEVLIMIT_ACC_MKNOD) {
|
||||
acc[index++] = 'm';
|
||||
accArray[index] = 'm';
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
STATIC CHAR DevLimitItemTypeToChar(INT16 type)
|
||||
{
|
||||
if (type == DEVLIMIT_DEV_ALL) {
|
||||
return 'a';
|
||||
} else if (type == DEVLIMIT_DEV_CHAR) {
|
||||
return 'c';
|
||||
} else if (type == DEVLIMIT_DEV_BLOCK) {
|
||||
return 'b';
|
||||
switch (type) {
|
||||
case DEVLIMIT_DEV_ALL:
|
||||
return 'a';
|
||||
case DEVLIMIT_DEV_CHAR:
|
||||
return 'c';
|
||||
case DEVLIMIT_DEV_BLOCK:
|
||||
return 'b';
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 'X';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue