Просмотр исходного кода

qcacld-3.0: Replace typedef tSirSmeAssocCnf

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 tSirSmeAssocCnf 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: Ib92a362137aa6f70db58a782a9f5b47e59cfbc15
CRs-Fixed: 2395001
Jeff Johnson 6 лет назад
Родитель
Сommit
f86e45b94b

+ 2 - 2
core/mac/inc/sir_api.h

@@ -1131,14 +1131,14 @@ struct assoc_ind {
 
 /* / Definition for Association confirm */
 /* / ---> MAC */
-typedef struct sSirSmeAssocCnf {
+struct assoc_cnf {
 	uint16_t messageType;   /* eWNI_SME_ASSOC_CNF */
 	uint16_t length;
 	tSirResultCodes statusCode;
 	struct qdf_mac_addr bssid;      /* Self BSSID */
 	struct qdf_mac_addr peer_macaddr;
 	uint16_t aid;
-} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
+};
 
 /* / Enum definition for  Wireless medium status change codes */
 typedef enum eSirSmeStatusChangeCode {

+ 11 - 21
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -315,32 +315,22 @@ fail:
 }
 
 /**
- * __lim_is_sme_assoc_cnf_valid()
+ * __lim_is_sme_assoc_cnf_valid() -- Validate ASSOC_CNF message
+ * @assoc_cnf: Pointer to Received ASSOC_CNF message
  *
- ***FUNCTION:
  * This function is called by __lim_process_sme_assoc_cnf_new() upon
  * receiving SME_ASSOC_CNF.
  *
- ***LOGIC:
- * Message validity checks are performed in this function
- *
- ***ASSUMPTIONS:
- *
- ***NOTE:
- *
- * @param  pMeasReq  Pointer to Received ASSOC_CNF message
- * @return true      When received SME_ASSOC_CNF is formatted
- *                   correctly
- *         false     otherwise
+ * Return: true when received SME_ASSOC_CNF is formatted correctly
+ *         false otherwise
  */
-
-static inline uint8_t __lim_is_sme_assoc_cnf_valid(tpSirSmeAssocCnf pAssocCnf)
+static bool __lim_is_sme_assoc_cnf_valid(struct assoc_cnf *assoc_cnf)
 {
-	if (qdf_is_macaddr_group(&pAssocCnf->peer_macaddr))
+	if (qdf_is_macaddr_group(&assoc_cnf->peer_macaddr))
 		return false;
-	else
-		return true;
-} /*** end __lim_is_sme_assoc_cnf_valid() ***/
+
+	return true;
+}
 
 /**
  * __lim_get_sme_join_req_size_for_alloc()
@@ -3176,7 +3166,7 @@ void lim_process_sme_del_bss_rsp(struct mac_context *mac,
 void __lim_process_sme_assoc_cnf_new(struct mac_context *mac_ctx, uint32_t msg_type,
 				uint32_t *msg_buf)
 {
-	tSirSmeAssocCnf assoc_cnf;
+	struct assoc_cnf assoc_cnf;
 	tpDphHashNode sta_ds = NULL;
 	struct pe_session *session_entry = NULL;
 	uint8_t session_id;
@@ -3187,7 +3177,7 @@ void __lim_process_sme_assoc_cnf_new(struct mac_context *mac_ctx, uint32_t msg_t
 		goto end;
 	}
 
-	qdf_mem_copy(&assoc_cnf, msg_buf, sizeof(struct sSirSmeAssocCnf));
+	qdf_mem_copy(&assoc_cnf, msg_buf, sizeof(assoc_cnf));
 	if (!__lim_is_sme_assoc_cnf_valid(&assoc_cnf)) {
 		pe_err("Received invalid SME_RE(ASSOC)_CNF message");
 		goto end;

+ 4 - 4
core/sme/src/csr/csr_api_roam.c

@@ -15484,16 +15484,16 @@ QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac,
 				  QDF_STATUS Halstatus)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	tSirSmeAssocCnf *pMsg;
+	struct assoc_cnf *pMsg;
 	struct scheduler_msg msg = { 0 };
 
 	sme_debug("Posting eWNI_SME_ASSOC_CNF to LIM.HalStatus: %d", Halstatus);
 	do {
-		pMsg = qdf_mem_malloc(sizeof(tSirSmeAssocCnf));
-		if (NULL == pMsg)
+		pMsg = qdf_mem_malloc(sizeof(*pMsg));
+		if (!pMsg)
 			return QDF_STATUS_E_NOMEM;
 		pMsg->messageType = eWNI_SME_ASSOC_CNF;
-		pMsg->length = sizeof(tSirSmeAssocCnf);
+		pMsg->length = sizeof(*pMsg);
 		if (QDF_IS_STATUS_SUCCESS(Halstatus))
 			pMsg->statusCode = eSIR_SME_SUCCESS;
 		else