mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
net: wireless: rockchip_wlan: bcmdhd: Call kernel_read/write() only when CONFIG_NO_GKI
kernel_read()/kernel_write() are missing from GKI symbol list. Signed-off-by: Tao Huang <huangtao@rock-chips.com> Change-Id: Iad8f6749840d8fdc6c80c751a3d229e9f04359de
This commit is contained in:
@@ -931,8 +931,13 @@ static inline struct inode *file_inode(const struct file *f)
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
|
||||
#ifdef CONFIG_NO_GKI
|
||||
#define vfs_write(fp, buf, len, pos) kernel_write(fp, buf, len, pos)
|
||||
#define vfs_read(fp, buf, len, pos) kernel_read(fp, buf, len, pos)
|
||||
#else
|
||||
#define vfs_write(fp, buf, len, pos) ({ UNUSED_PARAMETER(fp); UNUSED_PARAMETER(buf); UNUSED_PARAMETER(len); UNUSED_PARAMETER(pos); -EPERM; })
|
||||
#define vfs_read(fp, buf, len, pos) ({ UNUSED_PARAMETER(fp); UNUSED_PARAMETER(buf); UNUSED_PARAMETER(len); UNUSED_PARAMETER(pos); -EPERM; })
|
||||
#endif
|
||||
int kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned long count);
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */
|
||||
#define kernel_read_compat(file, offset, addr, count) kernel_read(file, offset, addr, count)
|
||||
|
||||
@@ -1939,6 +1939,8 @@ osl_timer_del(osl_t *osh, osl_timer_t *t)
|
||||
int
|
||||
kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned long count)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_NO_GKI))
|
||||
return -EPERM;
|
||||
return (int)kernel_read(file, addr, (size_t)count, &offset);
|
||||
}
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) */
|
||||
|
||||
Reference in New Issue
Block a user