1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-11-22 13:34:47 +00:00

os_dep/osdep_service.c: improve code

Signed-off-by: Steve Jeong <steve@how2flow.net>
This commit is contained in:
Steve Jeong 2023-07-19 10:28:58 +09:00
parent d6a07317b4
commit 1644c2d576

View File

@ -2428,7 +2428,6 @@ static int readFile(struct file *fp, char *buf, int len)
while (sum < len) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
rlen = kernel_read(fp, buf + sum, len - sum, &fp->f_pos);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos);
@ -2460,7 +2459,6 @@ static int writeFile(struct file *fp, char *buf, int len)
while (sum < len) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
wlen = kernel_write(fp, buf + sum, len - sum, &fp->f_pos);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
wlen = __vfs_write(fp, buf + sum, len - sum, &fp->f_pos);
@ -3535,3 +3533,4 @@ int hwaddr_aton_i(const char *txt, u8 *addr)
return 0;
}
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);