Parcourir la source

qcacld-3.0: Replace typedef tSmePeerInfoHddCbkInfo

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 tSmePeerInfoHddCbkInfo typedef
does not meet any of those criteria, so replace it with a reference to
the underlying struct.

Further note the Linux Coding Style frowns upon mixed-case names so in
conjunction rename the underlying struct to be in compliance.

Change-Id: I751e865a5d3ad64ee46794a28a11b2671e405d34
CRs-Fixed: 2400318
Jeff Johnson il y a 6 ans
Parent
commit
56ba88aeb5
2 fichiers modifiés avec 16 ajouts et 14 suppressions
  1. 6 6
      core/sme/inc/sme_internal.h
  2. 10 8
      core/sme/src/common/sme_api.c

+ 6 - 6
core/sme/inc/sme_internal.h

@@ -70,14 +70,14 @@ typedef enum eSmeState {
 #define SME_IS_READY(mac)  (SME_STATE_READY == (mac)->sme.state)
 
 /* HDD Callback function */
-typedef void (*ibss_peer_info_cb)(void *pUserData,
-					tSirPeerInfoRspParams *infoParam);
+typedef void (*ibss_peer_info_cb)(void *cb_context,
+				  tSirPeerInfoRspParams *infoParam);
 
 /* Peer info */
-typedef struct tagSmePeerInfoHddCbkInfo {
-	void *pUserData;
+struct ibss_peer_info_cb_info {
+	void *peer_info_cb_context;
 	ibss_peer_info_cb peer_info_cb;
-} tSmePeerInfoHddCbkInfo;
+};
 
 /**
  * struct stats_ext_event - stats_ext_event payload
@@ -259,7 +259,7 @@ struct sme_context {
 	void **sme_cmd_buf_addr;
 	tDblLinkList sme_cmd_freelist;    /* preallocated roam cmd list */
 	enum QDF_OPMODE curr_device_mode;
-	tSmePeerInfoHddCbkInfo peerInfoParams;
+	struct ibss_peer_info_cb_info peerInfoParams;
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
 	host_event_wlan_status_payload_type eventPayload;
 #endif

+ 10 - 8
core/sme/src/common/sme_api.c

@@ -1761,19 +1761,21 @@ QDF_STATUS sme_ibss_peer_info_response_handler(struct mac_context *mac,
 					       tpSirIbssGetPeerInfoRspParams
 					       pIbssPeerInfoParams)
 {
-	if (NULL == mac) {
+	struct ibss_peer_info_cb_info *cb_info;
+
+	if (!mac) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_FATAL,
 			  "%s: mac is null", __func__);
 		return QDF_STATUS_E_FAILURE;
 	}
-	if (mac->sme.peerInfoParams.peer_info_cb == NULL) {
+	cb_info = &mac->sme.peerInfoParams;
+	if (!cb_info->peer_info_cb) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: HDD callback is null", __func__);
 		return QDF_STATUS_E_FAILURE;
 	}
-	mac->sme.peerInfoParams.peer_info_cb(mac->sme.peerInfoParams.pUserData,
-					     &pIbssPeerInfoParams->
-					     ibssPeerInfoRspParams);
+	cb_info->peer_info_cb(cb_info->peer_info_cb_context,
+			      &pIbssPeerInfoParams->ibssPeerInfoRspParams);
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -7631,14 +7633,14 @@ QDF_STATUS sme_send_rmc_action_period(mac_handle_t mac_handle,
 /*
  * sme_request_ibss_peer_info() -  request ibss peer info
  * @mac_handle: Opaque handle to the global MAC context
- * @pUserData: Pointer to user data
+ * @cb_context: Pointer to user data
  * @peer_info_cb: Peer info callback
  * @allPeerInfoReqd: All peer info required or not
  * @staIdx: sta index
  *
  * Return:  QDF_STATUS
  */
-QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle, void *pUserData,
+QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle, void *cb_context,
 				      ibss_peer_info_cb peer_info_cb,
 				      bool allPeerInfoReqd, uint8_t staIdx)
 {
@@ -7651,7 +7653,7 @@ QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle, void *pUserData,
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_STATUS_SUCCESS == status) {
 		mac->sme.peerInfoParams.peer_info_cb = peer_info_cb;
-		mac->sme.peerInfoParams.pUserData = pUserData;
+		mac->sme.peerInfoParams.peer_info_cb_context = cb_context;
 
 		pIbssInfoReqParams = (tSirIbssGetPeerInfoReqParams *)
 			qdf_mem_malloc(sizeof(tSirIbssGetPeerInfoReqParams));