* [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes
@ 2021-03-26 9:48 Bruno Raoult
2021-03-26 9:48 ` [PATCH 1/5] r8192U_wx.c: style: alignment with open parenthesis Bruno Raoult
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Bruno Raoult @ 2021-03-26 9:48 UTC (permalink / raw)
To: gregkh, straube.linux, zhaoxiao, dan.carpenter
Cc: linux-staging, linux-kernel, Bruno Raoult
These 5 patches fix different issues reported by checkpatch.pl on
drivers/staging/r8192U/r8192U_wx.c :
Bruno Raoult (5):
r8192U_wx.c: style: alignment with open parenthesis
r8192U_wx.c: style: spaces preferred around operators
r8192U_wx.c: style: braces all arms of statement
r8192U_wx.c: style: Unnecessary parentheses around expr
r8192U_wx.c: style: avoid multiple blank lines
drivers/staging/rtl8192u/r8192U_wx.c | 139 +++++++++++++--------------
1 file changed, 69 insertions(+), 70 deletions(-)
Note: One checkpatch report about style remains in r8192U_wx.c after
applying these patches, to be fixed (?) in another patch.
--
2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/5] r8192U_wx.c: style: alignment with open parenthesis 2021-03-26 9:48 [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes Bruno Raoult @ 2021-03-26 9:48 ` Bruno Raoult 2021-03-26 9:48 ` [PATCH 2/5] r8192U_wx.c: style: spaces preferred around operators Bruno Raoult ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: Bruno Raoult @ 2021-03-26 9:48 UTC (permalink / raw) To: gregkh, straube.linux, zhaoxiao, dan.carpenter Cc: linux-staging, linux-kernel, Bruno Raoult fix checkpatch.pl check: CHECK: Alignment should match open parenthesis in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> --- drivers/staging/rtl8192u/r8192U_wx.c | 124 +++++++++++++-------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index e6ff310f3e90..3ff6da837ac1 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -77,8 +77,8 @@ static int r8192_wx_set_rate(struct net_device *dev, } static int r8192_wx_set_rts(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; struct r8192_priv *priv = ieee80211_priv(dev); @@ -93,8 +93,8 @@ static int r8192_wx_set_rts(struct net_device *dev, } static int r8192_wx_get_rts(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -102,8 +102,8 @@ static int r8192_wx_get_rts(struct net_device *dev, } static int r8192_wx_set_power(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; struct r8192_priv *priv = ieee80211_priv(dev); @@ -118,8 +118,8 @@ static int r8192_wx_set_power(struct net_device *dev, } static int r8192_wx_get_power(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -127,8 +127,8 @@ static int r8192_wx_get_power(struct net_device *dev, } static int r8192_wx_force_reset(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -141,8 +141,8 @@ static int r8192_wx_force_reset(struct net_device *dev, } static int r8192_wx_set_rawtx(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); int ret; @@ -456,9 +456,9 @@ static int r8192_wx_get_frag(struct net_device *dev, } static int r8192_wx_set_wap(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *awrq, - char *extra) + struct iw_request_info *info, + union iwreq_data *awrq, + char *extra) { int ret; struct r8192_priv *priv = ieee80211_priv(dev); @@ -557,23 +557,23 @@ static int r8192_wx_set_enc(struct net_device *dev, EnableHWSecurityConfig8192(dev); setKey(dev, - key_idx, /* EntryNo */ - key_idx, /* KeyIndex */ - KEY_TYPE_WEP40, /* KeyType */ - zero_addr[key_idx], - 0, /* DefaultKey */ - hwkey); /* KeyContent */ + key_idx, /* EntryNo */ + key_idx, /* KeyIndex */ + KEY_TYPE_WEP40, /* KeyType */ + zero_addr[key_idx], + 0, /* DefaultKey */ + hwkey); /* KeyContent */ } else if (wrqu->encoding.length == 0xd) { ieee->pairwise_key_type = KEY_TYPE_WEP104; EnableHWSecurityConfig8192(dev); setKey(dev, - key_idx, /* EntryNo */ - key_idx, /* KeyIndex */ - KEY_TYPE_WEP104, /* KeyType */ - zero_addr[key_idx], - 0, /* DefaultKey */ - hwkey); /* KeyContent */ + key_idx, /* EntryNo */ + key_idx, /* KeyIndex */ + KEY_TYPE_WEP104, /* KeyType */ + zero_addr[key_idx], + 0, /* DefaultKey */ + hwkey); /* KeyContent */ } else { netdev_warn(dev, "wrong type in WEP, not WEP40 and WEP104\n"); } @@ -583,7 +583,7 @@ static int r8192_wx_set_enc(struct net_device *dev, } static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa, - union iwreq_data *wrqu, char *p) + union iwreq_data *wrqu, char *p) { struct r8192_priv *priv = ieee80211_priv(dev); int *parms = (int *)p; @@ -595,8 +595,8 @@ static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info } static int r8192_wx_set_retry(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); int err = 0; @@ -640,8 +640,8 @@ static int r8192_wx_set_retry(struct net_device *dev, } static int r8192_wx_get_retry(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -663,8 +663,8 @@ static int r8192_wx_get_retry(struct net_device *dev, } static int r8192_wx_get_sens(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -675,8 +675,8 @@ static int r8192_wx_get_sens(struct net_device *dev, } static int r8192_wx_set_sens(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { struct r8192_priv *priv = ieee80211_priv(dev); short err = 0; @@ -699,8 +699,8 @@ static int r8192_wx_set_sens(struct net_device *dev, /* hw security need to reorganized. */ static int r8192_wx_set_enc_ext(struct net_device *dev, - 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; struct r8192_priv *priv = ieee80211_priv(dev); @@ -738,29 +738,29 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, if ((alg & KEY_TYPE_WEP40) && (ieee->auth_mode != 2)) { setKey(dev, - idx, /* EntryNao */ - idx, /* KeyIndex */ - alg, /* KeyType */ - zero, /* MacAddr */ - 0, /* DefaultKey */ - key); /* KeyContent */ + idx, /* EntryNao */ + idx, /* KeyIndex */ + alg, /* KeyType */ + zero, /* MacAddr */ + 0, /* DefaultKey */ + key); /* KeyContent */ } else if (group) { ieee->group_key_type = alg; setKey(dev, - idx, /* EntryNo */ - idx, /* KeyIndex */ - alg, /* KeyType */ - broadcast_addr, /* MacAddr */ - 0, /* DefaultKey */ - key); /* KeyContent */ + idx, /* EntryNo */ + idx, /* KeyIndex */ + alg, /* KeyType */ + broadcast_addr, /* MacAddr */ + 0, /* DefaultKey */ + key); /* KeyContent */ } else { /* pairwise key */ setKey(dev, - 4, /* EntryNo */ - idx, /* KeyIndex */ - alg, /* KeyType */ - (u8 *)ieee->ap_mac_addr,/* MacAddr */ - 0, /* DefaultKey */ - key); /* KeyContent */ + 4, /* EntryNo */ + idx, /* KeyIndex */ + alg, /* KeyType */ + (u8 *)ieee->ap_mac_addr,/* MacAddr */ + 0, /* DefaultKey */ + key); /* KeyContent */ } } @@ -771,8 +771,8 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, } static int r8192_wx_set_auth(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *data, char *extra) + struct iw_request_info *info, + union iwreq_data *data, char *extra) { int ret = 0; struct r8192_priv *priv = ieee80211_priv(dev); @@ -784,8 +784,8 @@ static int r8192_wx_set_auth(struct net_device *dev, } static int r8192_wx_set_mlme(struct net_device *dev, - 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; struct r8192_priv *priv = ieee80211_priv(dev); @@ -798,8 +798,8 @@ static int r8192_wx_set_mlme(struct net_device *dev, } static int r8192_wx_set_gen_ie(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *data, char *extra) + struct iw_request_info *info, + union iwreq_data *data, char *extra) { int ret = 0; struct r8192_priv *priv = ieee80211_priv(dev); -- 2.27.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] r8192U_wx.c: style: spaces preferred around operators 2021-03-26 9:48 [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes Bruno Raoult 2021-03-26 9:48 ` [PATCH 1/5] r8192U_wx.c: style: alignment with open parenthesis Bruno Raoult @ 2021-03-26 9:48 ` Bruno Raoult 2021-03-26 9:48 ` [PATCH 3/5] r8192U_wx.c: style: braces all arms of statement Bruno Raoult ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: Bruno Raoult @ 2021-03-26 9:48 UTC (permalink / raw) To: gregkh, straube.linux, zhaoxiao, dan.carpenter Cc: linux-staging, linux-kernel, Bruno Raoult fix checkpatch.pl check: CHECK: spaces required around that <op> in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> --- drivers/staging/rtl8192u/r8192U_wx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index 3ff6da837ac1..039471bcd5b1 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -294,7 +294,7 @@ static int rtl8180_wx_get_range(struct net_device *dev, for (i = 0, val = 0; i < 14; i++) { /* Include only legal frequencies for some countries */ - if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) { + if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i + 1]) { range->freq[val].i = i + 1; range->freq[val].m = ieee80211_wlan_frequencies[i] * 100000; range->freq[val].e = 1; @@ -309,8 +309,8 @@ static int rtl8180_wx_get_range(struct net_device *dev, } range->num_frequency = val; range->num_channels = val; - range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2| - IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP; + range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | + IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; tmp->scan_capa = 0x01; return 0; } @@ -722,7 +722,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, goto end_hw_sec; /* as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4; */ - alg = (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg; + alg = (ext->alg == IW_ENCODE_ALG_CCMP) ? KEY_TYPE_CCMP : ext->alg; idx = encoding->flags & IW_ENCODE_INDEX; if (idx) idx--; -- 2.27.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] r8192U_wx.c: style: braces all arms of statement 2021-03-26 9:48 [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes Bruno Raoult 2021-03-26 9:48 ` [PATCH 1/5] r8192U_wx.c: style: alignment with open parenthesis Bruno Raoult 2021-03-26 9:48 ` [PATCH 2/5] r8192U_wx.c: style: spaces preferred around operators Bruno Raoult @ 2021-03-26 9:48 ` Bruno Raoult 2021-03-26 9:48 ` [PATCH 4/5] r8192U_wx.c: style: Unnecessary parentheses Bruno Raoult 2021-03-26 9:48 ` [PATCH 5/5] r8192U_wx.c: style: avoid multiple blank lines Bruno Raoult 4 siblings, 0 replies; 6+ messages in thread From: Bruno Raoult @ 2021-03-26 9:48 UTC (permalink / raw) To: gregkh, straube.linux, zhaoxiao, dan.carpenter Cc: linux-staging, linux-kernel, Bruno Raoult fix checkpatch.pl check: CHECK: braces {} should be used on all arms of this statement in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> --- drivers/staging/rtl8192u/r8192U_wx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index 039471bcd5b1..03791613853f 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -429,9 +429,9 @@ static int r8192_wx_set_frag(struct net_device *dev, { struct r8192_priv *priv = ieee80211_priv(dev); - if (wrqu->frag.disabled) + if (wrqu->frag.disabled) { priv->ieee80211->fts = DEFAULT_FRAG_THRESHOLD; - else { + } else { if (wrqu->frag.value < MIN_FRAG_THRESHOLD || wrqu->frag.value > MAX_FRAG_THRESHOLD) return -EINVAL; -- 2.27.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] r8192U_wx.c: style: Unnecessary parentheses 2021-03-26 9:48 [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes Bruno Raoult ` (2 preceding siblings ...) 2021-03-26 9:48 ` [PATCH 3/5] r8192U_wx.c: style: braces all arms of statement Bruno Raoult @ 2021-03-26 9:48 ` Bruno Raoult 2021-03-26 9:48 ` [PATCH 5/5] r8192U_wx.c: style: avoid multiple blank lines Bruno Raoult 4 siblings, 0 replies; 6+ messages in thread From: Bruno Raoult @ 2021-03-26 9:48 UTC (permalink / raw) To: gregkh, straube.linux, zhaoxiao, dan.carpenter Cc: linux-staging, linux-kernel, Bruno Raoult fix checkpatch.pl check: CHECK: Unnecessary parentheses around expr in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> --- drivers/staging/rtl8192u/r8192U_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index 03791613853f..e0d32f7b0ace 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -778,7 +778,7 @@ static int r8192_wx_set_auth(struct net_device *dev, struct r8192_priv *priv = ieee80211_priv(dev); mutex_lock(&priv->wx_mutex); - ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra); + ret = ieee80211_wx_set_auth(priv->ieee80211, info, &data->param, extra); mutex_unlock(&priv->wx_mutex); return ret; } -- 2.27.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] r8192U_wx.c: style: avoid multiple blank lines 2021-03-26 9:48 [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes Bruno Raoult ` (3 preceding siblings ...) 2021-03-26 9:48 ` [PATCH 4/5] r8192U_wx.c: style: Unnecessary parentheses Bruno Raoult @ 2021-03-26 9:48 ` Bruno Raoult 4 siblings, 0 replies; 6+ messages in thread From: Bruno Raoult @ 2021-03-26 9:48 UTC (permalink / raw) To: gregkh, straube.linux, zhaoxiao, dan.carpenter Cc: linux-staging, linux-kernel, Bruno Raoult fix checkpatch.pl check: CHECK: Please don't use multiple blank lines in drivers/staging/rtl8192u/r8192U_wx.c Signed-off-by: Bruno Raoult <braoult@gmail.com> --- drivers/staging/rtl8192u/r8192U_wx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index e0d32f7b0ace..203ea3bfc843 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -877,7 +877,6 @@ static iw_handler r8192_wx_handlers[] = { }; - static const struct iw_priv_args r8192_private_args[] = { { SIOCIWFIRSTPRIV + 0x0, -- 2.27.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-26 9:49 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-03-26 9:48 [PATCH 0/5] staging: r8192U_wx.c: multiple style fixes Bruno Raoult 2021-03-26 9:48 ` [PATCH 1/5] r8192U_wx.c: style: alignment with open parenthesis Bruno Raoult 2021-03-26 9:48 ` [PATCH 2/5] r8192U_wx.c: style: spaces preferred around operators Bruno Raoult 2021-03-26 9:48 ` [PATCH 3/5] r8192U_wx.c: style: braces all arms of statement Bruno Raoult 2021-03-26 9:48 ` [PATCH 4/5] r8192U_wx.c: style: Unnecessary parentheses Bruno Raoult 2021-03-26 9:48 ` [PATCH 5/5] r8192U_wx.c: style: avoid multiple blank lines Bruno Raoult
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox