From 397bbaeacf05b78383afd2e1bf3587943c3789a8 Mon Sep 17 00:00:00 2001 From: Phillip Potter Date: Thu, 19 Aug 2021 00:48:47 +0100 Subject: [PATCH] convert only rtw_vmalloc call to vmalloc Convert the only call to rtw_vmalloc in os_dep/ioctl_linux.c to the kernel's existing vmalloc function, as rtw_malloc is just a preprocessor definition for _rtw_vmalloc. The _rtw_vmalloc function is defined inline and returns a u8, wrapping standard vmalloc. This behaviour is not necessary. Link: https://lore.kernel.org/r/20210818234853.208448-2-phil@philpotter.co.uk --- core/efuse/rtw_efuse.c | 8 ++++---- os_dep/linux/ioctl_linux.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index e99dd7c..298e26b 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -3144,9 +3144,9 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size) goto exit; } - file_data = rtw_vmalloc(file_size); + file_data = vmalloc(file_size); if (!file_data) { - RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, file_size); + RTW_ERR("%s vmalloc(%d) fail\n", __func__, file_size); goto exit; } @@ -3156,9 +3156,9 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size) goto exit; } - map = rtw_vmalloc(map_size); + map = vmalloc(map_size); if (!map) { - RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, map_size); + RTW_ERR("%s vmalloc(%d) fail\n", __func__, map_size); goto exit; } memset(map, 0xff, map_size); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 7ea673a..3dc3c62 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -7838,7 +7838,7 @@ static int rtw_wx_set_priv(struct net_device *dev, return -EFAULT; len = dwrq->length; - ext = rtw_vmalloc(len); + ext = vmalloc(len); if (!ext) return -ENOMEM; @@ -7850,7 +7850,7 @@ static int rtw_wx_set_priv(struct net_device *dev, #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV - ext_dbg = rtw_vmalloc(len); + ext_dbg = vmalloc(len); if (!ext_dbg) { vfree(ext); return -ENOMEM;