From 10cde6968b646512dcfda7ad6e52ca1084058296 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 8 Feb 2019 19:59:17 -0800 Subject: [PATCH] qcacld-3.0: Replace typedef tSirSmeHOFailureInd The Linux Coding Style enumerates a few special cases where typedefs are useful, but stresses "NEVER EVER use a typedef unless you can clearly match one of those rules." The tSirSmeHOFailureInd typedef does not meet any of those criteria, so replace it (and the "tp" variant) with a reference to the underlying struct. Further note the Linux Coding Style frowns upon mixed-case names and so-called Hungarian notation, so in conjunction rename the underlying struct to be in compliance. Change-Id: I313e1155aa463bc55ae2467539755fd75cf8a8eb CRs-Fixed: 2399109 --- core/mac/inc/sir_api.h | 6 +++--- core/sme/src/csr/csr_api_roam.c | 9 +++++---- core/wma/src/wma_scan_roam.c | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index dace34f034..04cc22fa70 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3139,9 +3139,9 @@ struct roam_offload_synch_ind { }; #ifdef WLAN_FEATURE_ROAM_OFFLOAD -typedef struct sSirSmeHOFailureInd { - uint8_t sessionId; -} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd; +struct handoff_failure_ind { + uint8_t vdev_id; +}; struct roam_offload_synch_fail { uint8_t session_id; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 8f6fe39600..83995f5c16 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -19983,16 +19983,17 @@ void csr_roaming_report_diag_event(struct mac_context *mac_ctx, */ void csr_process_ho_fail_ind(struct mac_context *mac_ctx, void *pMsgBuf) { - tSirSmeHOFailureInd *pSmeHOFailInd = (tSirSmeHOFailureInd *) pMsgBuf; + struct handoff_failure_ind *pSmeHOFailInd = pMsgBuf; uint32_t sessionId; - if (pSmeHOFailInd) - sessionId = pSmeHOFailInd->sessionId; - else { + if (!pSmeHOFailInd) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "LFR3: Hand-Off Failure Ind is NULL"); return; } + + sessionId = pSmeHOFailInd->vdev_id; + /* Roaming is supported only on Infra STA Mode. */ if (!csr_roam_is_sta_mode(mac_ctx, sessionId)) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index dbca6a418d..0e95a5696e 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -3022,15 +3022,15 @@ int wma_rssi_breached_event_handler(void *handle, */ static void wma_roam_ho_fail_handler(tp_wma_handle wma, uint32_t vdev_id) { - tSirSmeHOFailureInd *ho_failure_ind; + struct handoff_failure_ind *ho_failure_ind; struct scheduler_msg sme_msg = { 0 }; QDF_STATUS qdf_status; - ho_failure_ind = qdf_mem_malloc(sizeof(tSirSmeHOFailureInd)); + ho_failure_ind = qdf_mem_malloc(sizeof(*ho_failure_ind)); if (!ho_failure_ind) return; - ho_failure_ind->sessionId = vdev_id; + ho_failure_ind->vdev_id = vdev_id; sme_msg.type = eWNI_SME_HO_FAIL_IND; sme_msg.bodyptr = ho_failure_ind; sme_msg.bodyval = 0;