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

qcacld-3.0: Replace typedef tSirRegisterMgmtFrame

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 tSirRegisterMgmtFrame 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: I9950f99a69a26f5f1e519f141dc15a407be9d584
CRs-Fixed: 2392401
Jeff Johnson 6 лет назад
Родитель
Сommit
78f7a1895e

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

@@ -344,7 +344,7 @@ struct supported_rates {
 #endif
 };
 
-typedef struct sSirRegisterMgmtFrame {
+struct register_mgmt_frame {
 	uint16_t messageType;
 	uint16_t length;
 	uint8_t sessionId;
@@ -352,7 +352,7 @@ typedef struct sSirRegisterMgmtFrame {
 	uint16_t frameType;
 	uint16_t matchLen;
 	uint8_t matchData[1];
-} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
+};
 
 /* / Generic type for sending a response message */
 /* / with result code to host software */

+ 2 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -4271,7 +4271,8 @@ static void __lim_process_sme_register_mgmt_frame_req(struct mac_context *mac_ct
 		uint32_t *msg_buf)
 {
 	QDF_STATUS qdf_status;
-	tpSirRegisterMgmtFrame sme_req = (tpSirRegisterMgmtFrame)msg_buf;
+	struct register_mgmt_frame *sme_req =
+					(struct register_mgmt_frame *)msg_buf;
 	struct mgmt_frm_reg_info *lim_mgmt_regn = NULL;
 	struct mgmt_frm_reg_info *next = NULL;
 	bool match = false;

+ 4 - 4
core/sme/src/common/sme_api.c

@@ -4629,7 +4629,7 @@ QDF_STATUS sme_register_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
 
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		tSirRegisterMgmtFrame *pMsg;
+		struct register_mgmt_frame *pMsg;
 		uint16_t len;
 		struct csr_roam_session *pSession = CSR_GET_SESSION(mac,
 							sessionId);
@@ -4648,7 +4648,7 @@ QDF_STATUS sme_register_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
 			return QDF_STATUS_E_FAILURE;
 		}
 
-		len = sizeof(tSirRegisterMgmtFrame) + matchLen;
+		len = sizeof(*pMsg) + matchLen;
 
 		pMsg = qdf_mem_malloc(len);
 		if (NULL == pMsg)
@@ -4690,7 +4690,7 @@ QDF_STATUS sme_deregister_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
 			 0));
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		tSirRegisterMgmtFrame *pMsg;
+		struct register_mgmt_frame *pMsg;
 		uint16_t len;
 		struct csr_roam_session *pSession = CSR_GET_SESSION(mac,
 							sessionId);
@@ -4709,7 +4709,7 @@ QDF_STATUS sme_deregister_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
 			return QDF_STATUS_E_FAILURE;
 		}
 
-		len = sizeof(tSirRegisterMgmtFrame) + matchLen;
+		len = sizeof(*pMsg) + matchLen;
 
 		pMsg = qdf_mem_malloc(len);
 		if (NULL == pMsg)