linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colton <cspur43@gmail.com>
To: gregkh@linuxfoundation.org
Cc: len.baker@gmx.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Staging: rtl8192e: rtllib_softmac_wx.c: Fixed multiple coding style issues
Date: Sat, 09 Apr 2022 03:24:30 -0500	[thread overview]
Message-ID: <7cf8c5e16847aa2a9430298ba264900227a90026.camel@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

    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@gmail.com>


[-- Attachment #2: 0001-Staging-rtl8192e-rtllib_softmac_wx.c-Fixed-multiple-.patch --]
[-- Type: text/x-patch, Size: 6074 bytes --]

From 42fd3afd5effcb667562a417e4e895fbc09cbc2c Mon Sep 17 00:00:00 2001
From: Colton <cspur43@gmail.com>
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@gmail.com>
---
 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


             reply	other threads:[~2022-04-09  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09  8:24 Colton [this message]
2022-04-09 10:06 ` Staging: rtl8192e: rtllib_softmac_wx.c: Fixed multiple coding style issues Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cf8c5e16847aa2a9430298ba264900227a90026.camel@gmail.com \
    --to=cspur43@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.baker@gmx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).