Staging: wlan-ng: Solved Coding Style issues
PATCH 1/4 Staging: wlan-ng: Solved Coding Style issues
Solved parenthesis alignment issues throw by checkpatch.pl
Signed-off-by Pablo Pellecchia <[email protected]>
--- drivers/staging/wlan-ng/cfg80211.c | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-)
drivers/staging/wlan-ng/cfg80211.c +19 -21
@@ -234,8 +234,8 @@ static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev,int result =0 ; result =prism2_domibset_uint32 (wlandev, - DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, - key_index); + DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, + key_index);if (result) err = -EFAULT ;
@@ -331,8 +331,8 @@ static int prism2_scan(struct wiphy *wiphy, (i < request->n_channels) && i <ARRAY_SIZE (prism2_channels); i++) msg1.channellist.data.data[i] = -ieee80211_frequency_to_channel ( - request->channels[i]->center_freq); +ieee80211_frequency_to_channel + (request->channels[i]->center_freq); msg1.channellist.data.len = request->n_channels; msg1.maxchanneltime.data =250 ;
@@ -366,17 +366,16 @@ static int prism2_scan(struct wiphy *wiphy, freq =ieee80211_channel_to_frequency (msg2.dschannel.data,NL80211_BAND_2GHZ ); bss =cfg80211_inform_bss (wiphy, -ieee80211_get_channel (wiphy, freq), -CFG80211_BSS_FTYPE_UNKNOWN , - (const u8 *)&msg2.bssid.data.data, - msg2.timestamp.data, msg2.capinfo.data, - msg2.beaconperiod.data, - ie_buf, - ie_len, - (msg2.signal.data -65536 ) *100 ,/* Conversion to signed type */ -GFP_KERNEL - ); - +ieee80211_get_channel (wiphy, freq), +CFG80211_BSS_FTYPE_UNKNOWN , + (const u8 *)&msg2.bssid.data.data, + msg2.timestamp.data, msg2.capinfo.data, + msg2.beaconperiod.data, + ie_buf, + ie_len, + (msg2.signal.data -65536 ) *100 ,/* Conversion to signed type */ +GFP_KERNEL + );if (!bss) { err = -ENOMEM ; goto exit;
@@ -482,14 +481,13 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, } result =prism2_domibset_uint32 (wlandev, - DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, - sme->key_idx); + DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, + sme->key_idx);if (result) goto exit;/* send key to driver */ - did =DIDmib_dot11smt_dot11WEPDefaultKeysTable_key ( - sme->key_idx +1 ); + did =DIDmib_dot11smt_dot11WEPDefaultKeysTable_key (sme->key_idx +1 ); result =prism2_domibset_pstr32 (wlandev, did, sme->key_len, (u8 *)sme->key);
@@ -595,8 +593,8 @@ static int prism2_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, data =MBM_TO_DBM (mbm); result =prism2_domibset_uint32 (wlandev, - DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel, - data); + DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel, + data);if (result) { err = -EFAULT ;
Signature · 14 lines
2.14.1 From 16682e3ba99b18e6ecead3865ce2d06459281887 Mon Sep 17 00:00:00 2001 From: Pablo Pellecchia <[email protected]> Date: Sun, 16 Sep 2018 15:56:36 -0300 Subject: [PATCH 2/4] Staging: wlan-ng: Solved coding style issues Added comments on struct hfa384x_usbctlxq structure Signed-off-by: Pablo Pellecchia <[email protected]> --- drivers/staging/wlan-ng/hfa384x.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/wlan-ng/hfa384x.h +3 -2
@@ -1182,11 +1182,12 @@ struct hfa384x_usbctlx {ctlx_usercb_t usercb;/* Async user callback, */ void *usercb_data;/* at CTLX completion */ -int variant;/* Identifies cmd variant */ +int variant;/* Identifies cmd variant */ }; +/*Queues for CTLX status.*/ struct hfa384x_usbctlxq { -spinlock_t lock; +spinlock_t lock;/*Spinlock to allow mutual exclusion*/ struct list_head pending;struct list_head active;struct list_head completing;
Signature · 15 lines
2.14.1 From a75dd8f88e5bbecdb6228e2c529b436748cf5929 Mon Sep 17 00:00:00 2001 From: Pablo Pellecchia <[email protected]> Date: Sun, 16 Sep 2018 15:59:34 -0300 Subject: [PATCH 3/4] Staging: wlan-ng: Solved wrong usless cast issue Checkpatch was throwing warnings with 'long int' casting considering it useless. So i fixed that to only 'long' cast Signed-off-by: Pablo Pellecchia <[email protected]> --- drivers/staging/wlan-ng/p80211conv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wlan-ng/p80211conv.c +1 -1
@@ -430,7 +430,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,/* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ netdev_err (netdev,"DIXII frame too large (%ld > %d)\n" , - (long int )(payload_length - + (long )(payload_length -sizeof (struct wlan_llc ) -sizeof (struct wlan_snap )), netdev->mtu);return 1 ;
Signature · 14 lines
2.14.1 From b3c401741387f39cc5f6eddf7216ed8cb4e942c1 Mon Sep 17 00:00:00 2001 From: Pablo Pellecchia <[email protected]> Date: Sun, 16 Sep 2018 16:04:25 -0300 Subject: [PATCH 4/4] Staging: wlan-ng: Solved coding style issues Solved parenthesis alignment issues Signed-off-by: Pablo Pellecchia <[email protected]> --- drivers/staging/wlan-ng/prism2mgmt.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/staging/wlan-ng/prism2mgmt.c +14 -14
@@ -228,8 +228,8 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)__le16 wordbuf[17 ]; result =hfa384x_drvr_setconfig16 (hw, - HFA384x_RID_CNFROAMINGMODE, - HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM); + HFA384x_RID_CNFROAMINGMODE, + HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);if (result) { netdev_err(wlandev->netdev, "setconfig(ROAMINGMODE) failed. result=%d\n",
@@ -275,8 +275,8 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp) }/* ibss options */ result =hfa384x_drvr_setconfig16 (hw, - HFA384x_RID_CREATEIBSS, - HFA384x_CREATEIBSS_JOINCREATEIBSS); + HFA384x_RID_CREATEIBSS, + HFA384x_CREATEIBSS_JOINCREATEIBSS);if (result) {netdev_err (wlandev->netdev,"Failed to set CREATEIBSS.\n" );
@@ -1167,8 +1167,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)if (hw->presniff_port_type !=0 ) { word = hw->presniff_port_type; result =hfa384x_drvr_setconfig16 (hw, - HFA384x_RID_CNFPORTTYPE, - word); + HFA384x_RID_CNFPORTTYPE, + word);if (result) { netdev_dbg (wlandev->netdev,
@@ -1198,8 +1198,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)if (wlandev->netdev->type ==ARPHRD_ETHER ) {/* Save macport 0 state */ result =hfa384x_drvr_getconfig16 (hw, - HFA384x_RID_CNFPORTTYPE, - &hw->presniff_port_type); + HFA384x_RID_CNFPORTTYPE, + &hw->presniff_port_type);if (result) { netdev_dbg (wlandev->netdev,
@@ -1209,8 +1209,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) }/* Save the wepflags state */ result =hfa384x_drvr_getconfig16 (hw, - HFA384x_RID_CNFWEPFLAGS, - &hw->presniff_wepflags); + HFA384x_RID_CNFWEPFLAGS, + &hw->presniff_wepflags);if (result) { netdev_dbg (wlandev->netdev,
@@ -1259,8 +1259,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)/* Set the port type to pIbss */ word = HFA384x_PORTTYPE_PSUEDOIBSS; result =hfa384x_drvr_setconfig16 (hw, - HFA384x_RID_CNFPORTTYPE, - word); + HFA384x_RID_CNFPORTTYPE, + word);if (result) { netdev_dbg (wlandev->netdev,
@@ -1276,8 +1276,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) HFA384x_WEPFLAGS_DISABLE_RXCRYPT; result =hfa384x_drvr_setconfig16 (hw, - HFA384x_RID_CNFWEPFLAGS, - word); + HFA384x_RID_CNFWEPFLAGS, + word); }if (result) {
Signature · 1 line
2.14.1
Greg KH
maintainerQuoted 12 lines · Pablo Pellecchia
Solved parenthesis alignment issues throw by checkpatch.pl
Signed-off-by Pablo Pellecchia <[email protected]>--- drivers/staging/wlan-ng/cfg80211.c | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-)drivers/staging/wlan-ng/cfg80211.c +0
-0
drivers/staging/wlan-ng/cfg80211.c static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev, · line 238
Quoted 7 lines
drivers/staging/wlan-ng/cfg80211.c +2
-2@@ -234,8 +234,8 @@ static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev,int result =0 ; result =prism2_domibset_uint32 (wlandev, - DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, - key_index); + DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID, + key_index);
And now you violate the line length rule :(
Which is why the code looks like it does, what you should really do is fix up that horridly long variable name. That will fix this properly. Can you do that instead?
thanks,
greg k-h