summaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng
diff options
context:
space:
mode:
authorTim Collier <osdevtc@gmail.com>2018-09-26 23:06:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-28 14:43:52 +0200
commit27575665f39c8c23d2a55d96665acf7151aad005 (patch)
tree0c0c3628bb97c763b3d89fcc46ecac0f8ab628a1 /drivers/staging/wlan-ng
parent04950c3faa212ada8753a316738030c21e013f75 (diff)
staging: wlan-ng: make switch case block format consistent
For switch statements with case blocks make the format consistent by applying K&R formatting, a space before the opening brace, single indentation of contained code, break inside the block and closing brace aligned with case. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r--drivers/staging/wlan-ng/hfa384x_usb.c48
-rw-r--r--drivers/staging/wlan-ng/p80211req.c20
-rw-r--r--drivers/staging/wlan-ng/prism2mib.c38
-rw-r--r--drivers/staging/wlan-ng/prism2sta.c61
4 files changed, 82 insertions, 85 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 16f7dd266e3b..fb32aaf13628 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3605,36 +3605,34 @@ static void hfa384x_usbout_callback(struct urb *urb)
prism2sta_ev_alloc(wlandev);
break;
- case -EPIPE:
- {
- struct hfa384x *hw = wlandev->priv;
+ case -EPIPE: {
+ struct hfa384x *hw = wlandev->priv;
- netdev_warn(hw->wlandev->netdev,
- "%s tx pipe stalled: requesting reset\n",
- wlandev->netdev->name);
- if (!test_and_set_bit
- (WORK_TX_HALT, &hw->usb_flags))
- schedule_work(&hw->usb_work);
- wlandev->netdev->stats.tx_errors++;
- break;
- }
+ netdev_warn(hw->wlandev->netdev,
+ "%s tx pipe stalled: requesting reset\n",
+ wlandev->netdev->name);
+ if (!test_and_set_bit
+ (WORK_TX_HALT, &hw->usb_flags))
+ schedule_work(&hw->usb_work);
+ wlandev->netdev->stats.tx_errors++;
+ break;
+ }
case -EPROTO:
case -ETIMEDOUT:
- case -EILSEQ:
- {
- struct hfa384x *hw = wlandev->priv;
-
- if (!test_and_set_bit
- (THROTTLE_TX, &hw->usb_flags) &&
- !timer_pending(&hw->throttle)) {
- mod_timer(&hw->throttle,
- jiffies + THROTTLE_JIFFIES);
- }
- wlandev->netdev->stats.tx_errors++;
- netif_stop_queue(wlandev->netdev);
- break;
+ case -EILSEQ: {
+ struct hfa384x *hw = wlandev->priv;
+
+ if (!test_and_set_bit
+ (THROTTLE_TX, &hw->usb_flags) &&
+ !timer_pending(&hw->throttle)) {
+ mod_timer(&hw->throttle,
+ jiffies + THROTTLE_JIFFIES);
}
+ wlandev->netdev->stats.tx_errors++;
+ netif_stop_queue(wlandev->netdev);
+ break;
+ }
case -ENOENT:
case -ESHUTDOWN:
diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
index ab920d6a112b..9f5c1267d829 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -172,7 +172,7 @@ static void p80211req_handlemsg(struct wlandevice *wlandev,
struct p80211msg *msg)
{
switch (msg->msgcode) {
- case DIDMSG_LNXREQ_HOSTWEP:{
+ case DIDMSG_LNXREQ_HOSTWEP: {
struct p80211msg_lnxreq_hostwep *req =
(struct p80211msg_lnxreq_hostwep *)msg;
wlandev->hostwep &=
@@ -182,15 +182,15 @@ static void p80211req_handlemsg(struct wlandevice *wlandev,
if (req->encrypt.data == P80211ENUM_truth_true)
wlandev->hostwep |= HOSTWEP_ENCRYPT;
- break;
+ break;
}
case DIDMSG_DOT11REQ_MIBGET:
- case DIDMSG_DOT11REQ_MIBSET:{
+ case DIDMSG_DOT11REQ_MIBSET: {
int isget = (msg->msgcode == DIDMSG_DOT11REQ_MIBGET);
struct p80211msg_dot11req_mibget *mib_msg =
(struct p80211msg_dot11req_mibget *)msg;
p80211req_mibset_mibget(wlandev, mib_msg, isget);
- break;
+ break;
}
} /* switch msg->msgcode */
}
@@ -215,7 +215,7 @@ static void p80211req_mibset_mibget(struct wlandevice *wlandev,
key, pstr->len);
break;
- case DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID:{
+ case DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID: {
u32 *data = (u32 *)mibitem->data;
if (isget) {
@@ -224,21 +224,21 @@ static void p80211req_mibset_mibget(struct wlandevice *wlandev,
wlandev->hostwep &= ~(HOSTWEP_DEFAULTKEY_MASK);
wlandev->hostwep |= (*data & HOSTWEP_DEFAULTKEY_MASK);
}
- break;
+ break;
}
- case DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED:{
+ case DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED: {
u32 *data = (u32 *)mibitem->data;
p80211req_handle_action(wlandev, data, isget,
HOSTWEP_PRIVACYINVOKED);
- break;
+ break;
}
- case DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED:{
+ case DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED: {
u32 *data = (u32 *)mibitem->data;
p80211req_handle_action(wlandev, data, isget,
HOSTWEP_EXCLUDEUNENCRYPTED);
- break;
+ break;
}
}
}
diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c
index 32a634478cc1..5c0dad42f523 100644
--- a/drivers/staging/wlan-ng/prism2mib.c
+++ b/drivers/staging/wlan-ng/prism2mib.c
@@ -707,27 +707,27 @@ static int prism2mib_priv(struct mibrec *mib,
struct p80211pstrd *pstr = data;
switch (mib->did) {
- case DIDMIB_LNX_CONFIGTABLE_RSNAIE:{
- struct hfa384x_wpa_data wpa;
+ case DIDMIB_LNX_CONFIGTABLE_RSNAIE: {
+ struct hfa384x_wpa_data wpa;
- if (isget) {
- hfa384x_drvr_getconfig(hw,
- HFA384x_RID_CNFWPADATA,
- (u8 *)&wpa,
- sizeof(wpa));
- pstr->len = le16_to_cpu(wpa.datalen);
- memcpy(pstr->data, wpa.data, pstr->len);
- } else {
- wpa.datalen = cpu_to_le16(pstr->len);
- memcpy(wpa.data, pstr->data, pstr->len);
-
- hfa384x_drvr_setconfig(hw,
- HFA384x_RID_CNFWPADATA,
- (u8 *)&wpa,
- sizeof(wpa));
- }
- break;
+ if (isget) {
+ hfa384x_drvr_getconfig(hw,
+ HFA384x_RID_CNFWPADATA,
+ (u8 *)&wpa,
+ sizeof(wpa));
+ pstr->len = le16_to_cpu(wpa.datalen);
+ memcpy(pstr->data, wpa.data, pstr->len);
+ } else {
+ wpa.datalen = cpu_to_le16(pstr->len);
+ memcpy(wpa.data, pstr->data, pstr->len);
+
+ hfa384x_drvr_setconfig(hw,
+ HFA384x_RID_CNFWPADATA,
+ (u8 *)&wpa,
+ sizeof(wpa));
}
+ break;
+ }
default:
netdev_err(wlandev->netdev, "Unhandled DID 0x%08x\n", mib->did);
}
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index 83e80fbf9c6a..b720f564ecde 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -336,21 +336,20 @@ static int prism2sta_mlmerequest(struct wlandevice *wlandev,
*/
case DIDMSG_LNXREQ_HOSTWEP:
break; /* ignore me. */
- case DIDMSG_LNXREQ_IFSTATE:
- {
- struct p80211msg_lnxreq_ifstate *ifstatemsg;
-
- pr_debug("Received mlme ifstate request\n");
- ifstatemsg = (struct p80211msg_lnxreq_ifstate *)msg;
- result =
- prism2sta_ifstate(wlandev,
- ifstatemsg->ifstate.data);
- ifstatemsg->resultcode.status =
- P80211ENUM_msgitem_status_data_ok;
- ifstatemsg->resultcode.data = result;
- result = 0;
- }
+ case DIDMSG_LNXREQ_IFSTATE: {
+ struct p80211msg_lnxreq_ifstate *ifstatemsg;
+
+ pr_debug("Received mlme ifstate request\n");
+ ifstatemsg = (struct p80211msg_lnxreq_ifstate *)msg;
+ result =
+ prism2sta_ifstate(wlandev,
+ ifstatemsg->ifstate.data);
+ ifstatemsg->resultcode.status =
+ P80211ENUM_msgitem_status_data_ok;
+ ifstatemsg->resultcode.data = result;
+ result = 0;
break;
+ }
case DIDMSG_LNXREQ_WLANSNIFF:
pr_debug("Received mlme wlansniff request\n");
result = prism2mgmt_wlansniff(wlandev, msg);
@@ -359,28 +358,28 @@ static int prism2sta_mlmerequest(struct wlandevice *wlandev,
pr_debug("Received mlme autojoin request\n");
result = prism2mgmt_autojoin(wlandev, msg);
break;
- case DIDMSG_LNXREQ_COMMSQUALITY:{
- struct p80211msg_lnxreq_commsquality *qualmsg;
+ case DIDMSG_LNXREQ_COMMSQUALITY: {
+ struct p80211msg_lnxreq_commsquality *qualmsg;
- pr_debug("Received commsquality request\n");
+ pr_debug("Received commsquality request\n");
- qualmsg = (struct p80211msg_lnxreq_commsquality *)msg;
+ qualmsg = (struct p80211msg_lnxreq_commsquality *)msg;
- qualmsg->link.status =
- P80211ENUM_msgitem_status_data_ok;
- qualmsg->level.status =
- P80211ENUM_msgitem_status_data_ok;
- qualmsg->noise.status =
- P80211ENUM_msgitem_status_data_ok;
+ qualmsg->link.status =
+ P80211ENUM_msgitem_status_data_ok;
+ qualmsg->level.status =
+ P80211ENUM_msgitem_status_data_ok;
+ qualmsg->noise.status =
+ P80211ENUM_msgitem_status_data_ok;
- qualmsg->link.data = le16_to_cpu(hw->qual.cq_curr_bss);
- qualmsg->level.data =
- le16_to_cpu(hw->qual.asl_curr_bss);
- qualmsg->noise.data = le16_to_cpu(hw->qual.anl_curr_fc);
- qualmsg->txrate.data = hw->txrate;
+ qualmsg->link.data = le16_to_cpu(hw->qual.cq_curr_bss);
+ qualmsg->level.data =
+ le16_to_cpu(hw->qual.asl_curr_bss);
+ qualmsg->noise.data = le16_to_cpu(hw->qual.anl_curr_fc);
+ qualmsg->txrate.data = hw->txrate;
- break;
- }
+ break;
+ }
default:
netdev_warn(wlandev->netdev,
"Unknown mgmt request message 0x%08x",