Bladeren bron

qcacld-3.0: Replace hdd_adapter_t in wlan_hdd_debugfs.[ch]

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

Change-Id: I4f9785dbd0735b530587226cd6f152d297c515e0
CRs-Fixed: 2101072
Jeff Johnson 7 jaren geleden
bovenliggende
commit
f0a3c61d63
2 gewijzigde bestanden met toevoegingen van 17 en 17 verwijderingen
  1. 4 4
      core/hdd/inc/wlan_hdd_debugfs.h
  2. 13 13
      core/hdd/src/wlan_hdd_debugfs.c

+ 4 - 4
core/hdd/inc/wlan_hdd_debugfs.h

@@ -29,15 +29,15 @@
 #define _WLAN_HDD_DEBUGFS_H
 
 #ifdef WLAN_DEBUGFS
-QDF_STATUS hdd_debugfs_init(hdd_adapter_t *adapter);
-void hdd_debugfs_exit(hdd_adapter_t *adapter);
+QDF_STATUS hdd_debugfs_init(struct hdd_adapter *adapter);
+void hdd_debugfs_exit(struct hdd_adapter *adapter);
 #else
-static inline QDF_STATUS hdd_debugfs_init(hdd_adapter_t *pAdapter)
+static inline QDF_STATUS hdd_debugfs_init(struct hdd_adapter *pAdapter)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline void hdd_debugfs_exit(hdd_adapter_t *adapter)
+static inline void hdd_debugfs_exit(struct hdd_adapter *adapter)
 {
 }
 #endif /* #ifdef WLAN_DEBUGFS */

+ 13 - 13
core/hdd/src/wlan_hdd_debugfs.c

@@ -63,7 +63,7 @@ static ssize_t __wcnss_wowenable_write(struct file *file,
 				     const char __user *buf, size_t count,
 				     loff_t *ppos)
 {
-	hdd_adapter_t *pAdapter;
+	struct hdd_adapter *pAdapter;
 	struct hdd_context *hdd_ctx;
 	char cmd[MAX_USER_COMMAND_SIZE_WOWL_ENABLE + 1];
 	char *sptr, *token;
@@ -74,7 +74,7 @@ static ssize_t __wcnss_wowenable_write(struct file *file,
 
 	ENTER();
 
-	pAdapter = (hdd_adapter_t *)file->private_data;
+	pAdapter = (struct hdd_adapter *)file->private_data;
 	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
 		hdd_err("Invalid adapter or adapter has invalid magic");
 		return -EINVAL;
@@ -183,7 +183,7 @@ static ssize_t __wcnss_wowpattern_write(struct file *file,
 				      const char __user *buf, size_t count,
 				      loff_t *ppos)
 {
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) file->private_data;
+	struct hdd_adapter *pAdapter = (struct hdd_adapter *) file->private_data;
 	struct hdd_context *hdd_ctx;
 	char cmd[MAX_USER_COMMAND_SIZE_WOWL_PATTERN + 1];
 	char *sptr, *token;
@@ -302,7 +302,7 @@ static ssize_t __wcnss_patterngen_write(struct file *file,
 				      const char __user *buf, size_t count,
 				      loff_t *ppos)
 {
-	hdd_adapter_t *pAdapter;
+	struct hdd_adapter *pAdapter;
 	struct hdd_context *pHddCtx;
 	tSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams;
 	tSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams;
@@ -318,7 +318,7 @@ static ssize_t __wcnss_patterngen_write(struct file *file,
 
 	ENTER();
 
-	pAdapter = (hdd_adapter_t *)file->private_data;
+	pAdapter = (struct hdd_adapter *)file->private_data;
 	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
 		hdd_err("Invalid adapter or adapter has invalid magic");
 		return -EINVAL;
@@ -573,7 +573,7 @@ static ssize_t __wlan_hdd_read_power_debugfs(struct file *file,
 		char __user *buf,
 		size_t count, loff_t *pos)
 {
-	hdd_adapter_t *adapter;
+	struct hdd_adapter *adapter;
 	struct hdd_context *hdd_ctx;
 	QDF_STATUS status;
 	struct power_stats_response *chip_power_stats;
@@ -591,7 +591,7 @@ static ssize_t __wlan_hdd_read_power_debugfs(struct file *file,
 	};
 
 	ENTER();
-	adapter = (hdd_adapter_t *)file->private_data;
+	adapter = (struct hdd_adapter *)file->private_data;
 	if ((!adapter) || (WLAN_HDD_ADAPTER_MAGIC != adapter->magic)) {
 		hdd_err("Invalid adapter or adapter has invalid magic");
 		return -EINVAL;
@@ -737,7 +737,7 @@ static int wlan_hdd_open_power_debugfs(struct inode *inode, struct file *file)
  */
 static int __wcnss_debugfs_open(struct inode *inode, struct file *file)
 {
-	hdd_adapter_t *adapter;
+	struct hdd_adapter *adapter;
 	struct hdd_context *hdd_ctx;
 	int ret;
 
@@ -746,7 +746,7 @@ static int __wcnss_debugfs_open(struct inode *inode, struct file *file)
 	if (inode->i_private)
 		file->private_data = inode->i_private;
 
-	adapter = (hdd_adapter_t *)file->private_data;
+	adapter = (struct hdd_adapter *)file->private_data;
 	if ((NULL == adapter) || (WLAN_HDD_ADAPTER_MAGIC != adapter->magic)) {
 		hdd_err("Invalid adapter or adapter has invalid magic");
 		return -EINVAL;
@@ -813,7 +813,7 @@ static const struct file_operations fops_powerdebugs = {
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS wlan_hdd_create_power_stats_file(hdd_adapter_t *adapter)
+static QDF_STATUS wlan_hdd_create_power_stats_file(struct hdd_adapter *adapter)
 {
 	if (!debugfs_create_file("power_stats", 00400 | 00040 | 00004,
 				adapter->debugfs_phy, adapter,
@@ -824,7 +824,7 @@ static QDF_STATUS wlan_hdd_create_power_stats_file(hdd_adapter_t *adapter)
 }
 
 #else
-static QDF_STATUS wlan_hdd_create_power_stats_file(hdd_adapter_t *adapter)
+static QDF_STATUS wlan_hdd_create_power_stats_file(struct hdd_adapter *adapter)
 {
 	return QDF_STATUS_SUCCESS;
 }
@@ -842,7 +842,7 @@ static QDF_STATUS wlan_hdd_create_power_stats_file(hdd_adapter_t *adapter)
  * Return: QDF_STATUS_SUCCESS if all files registered,
  *	   QDF_STATUS_E_FAILURE on failure
  */
-QDF_STATUS hdd_debugfs_init(hdd_adapter_t *adapter)
+QDF_STATUS hdd_debugfs_init(struct hdd_adapter *adapter)
 {
 	struct net_device *dev = adapter->dev;
 	adapter->debugfs_phy = debugfs_create_dir(dev->name, 0);
@@ -882,7 +882,7 @@ QDF_STATUS hdd_debugfs_init(hdd_adapter_t *adapter)
  *
  * Return: None
  */
-void hdd_debugfs_exit(hdd_adapter_t *adapter)
+void hdd_debugfs_exit(struct hdd_adapter *adapter)
 {
 	debugfs_remove_recursive(adapter->debugfs_phy);
 }