ソースを参照

qcacld-3.0: Replace typedef tSmeStruct

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 tSmeStruct 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 tagSmeStruct to be in compliance.

Change-Id: Ia817cc5d2b91a7cbddf4670edd049408deb71f63
CRs-Fixed: 2400311
Jeff Johnson 6 年 前
コミット
50980e16a9

+ 1 - 1
core/mac/inc/ani_global.h

@@ -764,7 +764,7 @@ struct mac_context {
 	/* PAL/HDD handle */
 	hdd_handle_t hdd_handle;
 
-	tSmeStruct sme;
+	struct sme_context sme;
 	tSapStruct sap;
 	struct csr_scanstruct scan;
 	struct csr_roamstruct roam;

+ 2 - 2
core/sme/inc/sme_inside.h

@@ -160,8 +160,8 @@ QDF_STATUS csr_roam_send_set_key_cmd(struct mac_context *mac_ctx,
 		uint32_t session_id, struct setkey_cmd *set_key_cmd);
 QDF_STATUS csr_is_valid_channel(struct mac_context *mac, uint8_t chnNum);
 
-QDF_STATUS sme_acquire_global_lock(tSmeStruct *psSme);
-QDF_STATUS sme_release_global_lock(tSmeStruct *psSme);
+QDF_STATUS sme_acquire_global_lock(struct sme_context *sme);
+QDF_STATUS sme_release_global_lock(struct sme_context *sme);
 
 QDF_STATUS csr_process_add_sta_session_rsp(struct mac_context *mac, uint8_t *pMsg);
 QDF_STATUS csr_process_del_sta_session_rsp(struct mac_context *mac, uint8_t *pMsg);

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

@@ -251,7 +251,7 @@ typedef void (*hidden_ssid_cb)(hdd_handle_t hdd_handle,
 typedef QDF_STATUS (*md_host_evt_cb)(void *hdd_ctx, struct sir_md_evt *event);
 #endif /* WLAN_FEATURE_MOTION_DETECTION */
 
-typedef struct tagSmeStruct {
+struct sme_context {
 	eSmeState state;
 	qdf_mutex_t lkSmeGlobalLock;
 	uint32_t totalSmeCmd;
@@ -344,6 +344,6 @@ typedef struct tagSmeStruct {
 	/* hidden ssid rsp callback */
 	hidden_ssid_cb hidden_ssid_cb;
 
-} tSmeStruct, *tpSmeStruct;
+};
 
 #endif /* #if !defined( __SMEINTERNAL_H ) */

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

@@ -77,30 +77,20 @@ static QDF_STATUS sme_stats_ext_event(struct mac_context *mac,
 				      struct stats_ext_event *msg);
 
 /* Internal SME APIs */
-QDF_STATUS sme_acquire_global_lock(tSmeStruct *psSme)
+QDF_STATUS sme_acquire_global_lock(struct sme_context *sme)
 {
-	QDF_STATUS status = QDF_STATUS_E_INVAL;
-
-	if (psSme) {
-		if (QDF_IS_STATUS_SUCCESS
-			    (qdf_mutex_acquire(&psSme->lkSmeGlobalLock)))
-			status = QDF_STATUS_SUCCESS;
-	}
+	if (!sme)
+		return QDF_STATUS_E_INVAL;
 
-	return status;
+	return qdf_mutex_acquire(&sme->lkSmeGlobalLock);
 }
 
-QDF_STATUS sme_release_global_lock(tSmeStruct *psSme)
+QDF_STATUS sme_release_global_lock(struct sme_context *sme)
 {
-	QDF_STATUS status = QDF_STATUS_E_INVAL;
-
-	if (psSme) {
-		if (QDF_IS_STATUS_SUCCESS
-			    (qdf_mutex_release(&psSme->lkSmeGlobalLock)))
-			status = QDF_STATUS_SUCCESS;
-	}
+	if (!sme)
+		return QDF_STATUS_E_INVAL;
 
-	return status;
+	return qdf_mutex_release(&sme->lkSmeGlobalLock);
 }
 
 struct mac_context *sme_get_mac_context(void)