Преглед изворни кода

qcacld-3.0: Replace typedef tSapContext

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 tSapContext typedef does not
meet any of those criteria, so replace it.

Change-Id: If237edee7638c1c6b35413312cb3dd934554431a
CRs-Fixed: 2109960
Jeff Johnson пре 7 година
родитељ
комит
6816303da2
3 измењених фајлова са 3 додато и 4 уклоњено
  1. 1 1
      core/sap/src/sap_fsm.c
  2. 0 1
      core/sap/src/sap_internal.h
  3. 2 2
      core/sap/src/sap_module.c

+ 1 - 1
core/sap/src/sap_fsm.c

@@ -1943,7 +1943,7 @@ QDF_STATUS sap_clear_session_param(tHalHandle hal, ptSapContext sapctx,
 	mac_ctx->sap.sapCtxList[sapctx->sessionId].sapPersona =
 		QDF_MAX_NO_OF_MODE;
 	sap_clear_global_dfs_param(hal);
-	qdf_mem_zero(sapctx, sizeof(tSapContext));
+	qdf_mem_zero(sapctx, sizeof(*sapctx));
 	sapctx->sessionId = CSR_SESSION_ID_INVALID;
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
 		"%s: Initializing State: %d, sapContext value = %p", __func__,

+ 0 - 1
core/sap/src/sap_internal.h

@@ -275,7 +275,6 @@ struct sap_context {
 	bool dfs_cac_offload;
 };
 typedef struct sap_context *ptSapContext;
-typedef struct sap_context tSapContext;
 
 /*----------------------------------------------------------------------------
  *  External declarations for global context

+ 2 - 2
core/sap/src/sap_module.c

@@ -263,11 +263,11 @@ void wlansap_context_put(ptSapContext ctx)
  */
 void *wlansap_open(void *p_cds_gctx)
 {
-	ptSapContext pSapCtx = NULL;
+	ptSapContext pSapCtx;
 	QDF_STATUS status;
 
 	/* dynamically allocate the sapContext */
-	pSapCtx = (ptSapContext) qdf_mem_malloc(sizeof(tSapContext));
+	pSapCtx = qdf_mem_malloc(sizeof(*pSapCtx));
 
 	if (NULL == pSapCtx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,