Staging: rtl8192e: rtllib_softmac_wx.c: Fixed multiple coding style issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    Staging: rtl8192e: rtllib_softmac_wx.c: Fixed multiple coding style issues
    
    Fixed issues  with whitespace, unbalanced braces unnecessary (int) casts, and attempted to fix alignment issue still flagged by checkpatch.pl
    
    Signed-off-by: Colton Spurgin <cspur43@xxxxxxxxx>

From 42fd3afd5effcb667562a417e4e895fbc09cbc2c Mon Sep 17 00:00:00 2001
From: Colton <cspur43@xxxxxxxxx>
Date: Sat, 9 Apr 2022 02:46:34 -0500
Subject: [PATCH] Staging: rtl8192e: rtllib_softmac_wx.c: Fixed multiple coding
 style issues

Fixed issues  with whitespace, unbalanced braces unnecessary (int) casts, and attempted to fix alignment issue still flagged by checkpatch.pl

Signed-off-by: Colton Spurgin <cspur43@xxxxxxxxx>
---
 drivers/staging/rtl8192e/rtllib_softmac_wx.c | 42 ++++++--------------
 1 file changed, 13 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index 57a6d1130b6a..f67b829f28d1 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -12,7 +12,6 @@
  * own it's copyright ;-)
  */
 #include <linux/etherdevice.h>
-
 #include "rtllib.h"
 #include "dot11d.h"
 /* FIXME: add A freqs */
@@ -25,7 +24,6 @@ const long rtllib_wlan_frequencies[] = {
 };
 EXPORT_SYMBOL(rtllib_wlan_frequencies);
 
-
 int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b)
 {
@@ -41,8 +39,8 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
 
 	/* if setting by freq convert to channel */
 	if (fwrq->e == 1) {
-		if ((fwrq->m >= (int) 2.412e8 &&
-		     fwrq->m <= (int) 2.487e8)) {
+		if ((fwrq->m >= 2.412e8 &&
+		     fwrq->m <= 2.487e8)) {
 			int f = fwrq->m / 100000;
 			int c = 0;
 
@@ -83,7 +81,6 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
 }
 EXPORT_SYMBOL(rtllib_wx_set_freq);
 
-
 int rtllib_wx_get_freq(struct rtllib_device *ieee,
 			     struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b)
@@ -92,7 +89,7 @@ int rtllib_wx_get_freq(struct rtllib_device *ieee,
 
 	if (ieee->current_network.channel == 0)
 		return -1;
-	fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel-1] *
+	fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel - 1] *
 		  100000;
 	fwrq->e = 1;
 	return 0;
@@ -128,13 +125,11 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee,
 }
 EXPORT_SYMBOL(rtllib_wx_get_wap);
 
-
 int rtllib_wx_set_wap(struct rtllib_device *ieee,
 			 struct iw_request_info *info,
 			 union iwreq_data *awrq,
 			 char *extra)
 {
-
 	int ret = 0;
 	unsigned long flags;
 
@@ -164,7 +159,6 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
 		goto out;
 	}
 
-
 	if (ifup)
 		rtllib_stop_protocol(ieee, true);
 
@@ -220,7 +214,6 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a,
 	spin_unlock_irqrestore(&ieee->lock, flags);
 
 	return ret;
-
 }
 EXPORT_SYMBOL(rtllib_wx_get_essid);
 
@@ -228,10 +221,9 @@ int rtllib_wx_set_rate(struct rtllib_device *ieee,
 			     struct iw_request_info *info,
 			     union iwreq_data *wrqu, char *extra)
 {
-
 	u32 target_rate = wrqu->bitrate.value;
 
-	ieee->rate = target_rate/100000;
+	ieee->rate = target_rate / 100000;
 	return 0;
 }
 EXPORT_SYMBOL(rtllib_wx_set_rate);
@@ -250,16 +242,15 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee,
 }
 EXPORT_SYMBOL(rtllib_wx_get_rate);
 
-
 int rtllib_wx_set_rts(struct rtllib_device *ieee,
 			     struct iw_request_info *info,
 			     union iwreq_data *wrqu, char *extra)
 {
 	if (wrqu->rts.disabled || !wrqu->rts.fixed)
 		ieee->rts = DEFAULT_RTS_THRESHOLD;
-	else {
+	} else {
 		if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
-				wrqu->rts.value > MAX_RTS_THRESHOLD)
+			wrqu->rts.value > MAX_RTS_THRESHOLD)
 			return -EINVAL;
 		ieee->rts = wrqu->rts.value;
 	}
@@ -268,8 +259,8 @@ int rtllib_wx_set_rts(struct rtllib_device *ieee,
 EXPORT_SYMBOL(rtllib_wx_set_rts);
 
 int rtllib_wx_get_rts(struct rtllib_device *ieee,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra)
+					struct iw_request_info *info,
+					union iwreq_data *wrqu, char *extra)
 {
 	wrqu->rts.value = ieee->rts;
 	wrqu->rts.fixed = 0;	/* no auto select */
@@ -279,7 +270,7 @@ int rtllib_wx_get_rts(struct rtllib_device *ieee,
 EXPORT_SYMBOL(rtllib_wx_get_rts);
 
 int rtllib_wx_set_mode(struct rtllib_device *ieee, struct iw_request_info *a,
-			     union iwreq_data *wrqu, char *b)
+						union iwreq_data *wrqu, char *b)
 {
 	int set_mode_status = 0;
 
@@ -410,7 +401,6 @@ void rtllib_wx_sync_scan_wq(void *data)
 
 out:
 	mutex_unlock(&ieee->wx_mutex);
-
 }
 
 int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
@@ -441,7 +431,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee,
 			struct iw_request_info *a,
 			union iwreq_data *wrqu, char *extra)
 {
-
 	int ret = 0, len, i;
 	short proto_started;
 	unsigned long flags;
@@ -468,7 +457,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee,
 	if (proto_started)
 		rtllib_stop_protocol(ieee, true);
 
-
 	/* this is just to be sure that the GET wx callback
 	 * has consistent infos. not needed otherwise
 	 */
@@ -551,11 +539,10 @@ int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info,
 }
 EXPORT_SYMBOL(rtllib_wx_get_name);
 
-
 /* this is mostly stolen from hostap */
 int rtllib_wx_set_power(struct rtllib_device *ieee,
-				 struct iw_request_info *info,
-				 union iwreq_data *wrqu, char *extra)
+						struct iw_request_info *info,
+						union iwreq_data *wrqu, char *extra)
 {
 	int ret = 0;
 
@@ -601,19 +588,17 @@ int rtllib_wx_set_power(struct rtllib_device *ieee,
 	default:
 		ret = -EINVAL;
 		goto exit;
-
 	}
 exit:
 	mutex_unlock(&ieee->wx_mutex);
 	return ret;
-
 }
 EXPORT_SYMBOL(rtllib_wx_set_power);
 
 /* this is stolen from hostap */
 int rtllib_wx_get_power(struct rtllib_device *ieee,
-				 struct iw_request_info *info,
-				 union iwreq_data *wrqu, char *extra)
+						struct iw_request_info *info,
+						union iwreq_data *wrqu, char *extra)
 {
 	mutex_lock(&ieee->wx_mutex);
 
@@ -643,6 +628,5 @@ int rtllib_wx_get_power(struct rtllib_device *ieee,
 exit:
 	mutex_unlock(&ieee->wx_mutex);
 	return 0;
-
 }
 EXPORT_SYMBOL(rtllib_wx_get_power);
-- 
2.35.1


[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux