From 61c999d5cd86bfc495bda60002e89fefbdff78d3 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 5 Nov 2018 12:57:03 -0800 Subject: [PATCH] qcacld-3.0: Replace tAniSirGlobal with the underlying struct Change "qcacld-3.0: Rename struct sAniSirGlobal to mac_context" (Change-Id Ibaaeb5296e42a24c66d4adf4f720d32a9ae41888) introduced a new name for the global MAC context. In addition, the Linux coding style document tells us "In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef." To align with the new name, as well as to align with the guidance from the Linux coding style, replace all instances of typedef tAniSirGlobal with the underlying struct mac_context. Change-Id: Ibb6c1f69fecbe00a17f4cc98a28706d859fa2928 CRs-Fixed: 2346156 --- core/mac/inc/ani_global.h | 4 ---- core/mac/src/sys/legacy/src/system/src/mac_init_api.c | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index b9b2f242d3..e4f7239b86 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -915,10 +915,6 @@ struct mac_context { bool obss_scan_offload; }; -/* legacy definitions in place until converted to use struct mac_context */ -typedef struct mac_context tAniSirGlobal; - - #ifdef FEATURE_WLAN_TDLS #define RFC1042_HDR_LENGTH (6) diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c index cbb30237cf..bddb10cd55 100644 --- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c +++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c @@ -41,11 +41,11 @@ #endif #ifdef WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY -static tAniSirGlobal *global_mac_context; +static struct mac_context *global_mac_context; static inline tpAniSirGlobal mac_allocate_context_buffer(void) { - global_mac_context = qdf_mem_malloc(sizeof(tAniSirGlobal)); + global_mac_context = qdf_mem_malloc(sizeof(*global_mac_context)); return global_mac_context; } @@ -56,7 +56,7 @@ static inline void mac_free_context_buffer(void) global_mac_context = NULL; } #else /* WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY */ -static tAniSirGlobal global_mac_context; +static struct mac_context global_mac_context; static inline tpAniSirGlobal mac_allocate_context_buffer(void) {