From 1f6c1424cccc500acdc3842ff6b3bfabf8dde0aa Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 24 Dec 2018 16:34:30 -0600 Subject: [PATCH] rtl8188eu: Remove all code associated with DBG_MEMORY_LEAK This parameter is always undefined. Signed-off-by: Larry Finger --- core/rtw_debug.c | 14 -------------- include/autoconf.h | 2 -- include/rtw_debug.h | 4 ---- os_dep/osdep_service.c | 34 +--------------------------------- os_dep/rtw_proc.c | 4 ---- 5 files changed, 1 insertion(+), 57 deletions(-) diff --git a/core/rtw_debug.c b/core/rtw_debug.c index e533cd8..83e10f7 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -3079,20 +3079,6 @@ int proc_get_rtkm_info(struct seq_file *m, void *v) } #endif /* CONFIG_PREALLOC_RX_SKB_BUFFER */ -#ifdef DBG_MEMORY_LEAK -#include -extern atomic_t _malloc_cnt;; -extern atomic_t _malloc_size;; - -int proc_get_malloc_cnt(struct seq_file *m, void *v) -{ - RTW_PRINT_SEL(m, "_malloc_cnt=%d\n", atomic_read(&_malloc_cnt)); - RTW_PRINT_SEL(m, "_malloc_size=%d\n", atomic_read(&_malloc_size)); - - return 0; -} -#endif /* DBG_MEMORY_LEAK */ - #ifdef CONFIG_FIND_BEST_CHANNEL int proc_get_best_channel(struct seq_file *m, void *v) { diff --git a/include/autoconf.h b/include/autoconf.h index ad69e72..4bdd5b1 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -349,8 +349,6 @@ /* #define DBG_HAL_INIT_PROFILING */ -/* #define DBG_MEMORY_LEAK */ - /* TX use 1 urb */ /* #define CONFIG_SINGLE_XMIT_BUF */ /* RX use 1 urb */ diff --git a/include/rtw_debug.h b/include/rtw_debug.h index 600a829..2632527 100644 --- a/include/rtw_debug.h +++ b/include/rtw_debug.h @@ -412,10 +412,6 @@ int proc_get_tx_stat(struct seq_file *m, void *v); int proc_get_all_sta_info(struct seq_file *m, void *v); #endif /* CONFIG_AP_MODE */ -#ifdef DBG_MEMORY_LEAK -int proc_get_malloc_cnt(struct seq_file *m, void *v); -#endif /* DBG_MEMORY_LEAK */ - #ifdef CONFIG_FIND_BEST_CHANNEL int proc_get_best_channel(struct seq_file *m, void *v); ssize_t proc_set_best_channel(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 2366246..f1740b1 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -25,11 +25,6 @@ #define RT_TAG '1178' -#ifdef DBG_MEMORY_LEAK -atomic_t _malloc_cnt = ATOMIC_INIT(0); -atomic_t _malloc_size = ATOMIC_INIT(0); -#endif /* DBG_MEMORY_LEAK */ - /* * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE * @return: one of RTW_STATUS_CODE @@ -69,17 +64,7 @@ u32 rtw_atoi(u8 *s) inline u8 *_rtw_vmalloc(u32 sz) { - u8 *pbuf; - - pbuf = vmalloc(sz); -#ifdef DBG_MEMORY_LEAK - if (pbuf != NULL) { - atomic_inc(&_malloc_cnt); - atomic_add(sz, &_malloc_size); - } -#endif /* DBG_MEMORY_LEAK */ - - return pbuf; + return vmalloc(sz); } inline u8 *_rtw_zvmalloc(u32 sz) @@ -94,10 +79,6 @@ inline u8 *_rtw_zvmalloc(u32 sz) inline void _rtw_vmfree(u8 *pbuf, u32 sz) { vfree(pbuf); -#ifdef DBG_MEMORY_LEAK - atomic_dec(&_malloc_cnt); - atomic_sub(sz, &_malloc_size); -#endif /* DBG_MEMORY_LEAK */ } u8 *_rtw_malloc(u32 sz) @@ -111,17 +92,9 @@ u8 *_rtw_malloc(u32 sz) #endif pbuf = kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -#ifdef DBG_MEMORY_LEAK - if (pbuf != NULL) { - atomic_inc(&_malloc_cnt); - atomic_add(sz, &_malloc_size); - } -#endif /* DBG_MEMORY_LEAK */ - return pbuf; } - u8 *_rtw_zmalloc(u32 sz) { u8 *pbuf = _rtw_malloc(sz); @@ -139,11 +112,6 @@ void _rtw_mfree(u8 *pbuf, u32 sz) else #endif kfree(pbuf); - -#ifdef DBG_MEMORY_LEAK - atomic_dec(&_malloc_cnt); - atomic_sub(sz, &_malloc_size); -#endif /* DBG_MEMORY_LEAK */ } inline struct sk_buff *_rtw_skb_alloc(u32 sz) diff --git a/os_dep/rtw_proc.c b/os_dep/rtw_proc.c index cdd9c75..628a7aa 100644 --- a/os_dep/rtw_proc.c +++ b/os_dep/rtw_proc.c @@ -2338,10 +2338,6 @@ static const struct rtw_proc_hdl adapter_proc_hdls[] = { RTW_PROC_HDL_SSEQ("all_sta_info", proc_get_all_sta_info, NULL), #endif /* CONFIG_AP_MODE */ -#ifdef DBG_MEMORY_LEAK - RTW_PROC_HDL_SSEQ("_malloc_cnt", proc_get_malloc_cnt, NULL), -#endif /* DBG_MEMORY_LEAK */ - #ifdef CONFIG_FIND_BEST_CHANNEL RTW_PROC_HDL_SSEQ("best_channel", proc_get_best_channel, proc_set_best_channel), #endif