Skip to content

Commit 8b3e7be

Browse files
speachylinvjw
authored andcommitted
cw1200: Fix an assorted pile of checkpatch warnings.
Signed-off-by: Solomon Peachy <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 19db577 commit 8b3e7be

File tree

9 files changed

+80
-75
lines changed

9 files changed

+80
-75
lines changed

drivers/net/wireless/cw1200/bh.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ static int cw1200_bh(void *arg);
3131

3232
#define DOWNLOAD_BLOCK_SIZE_WR (0x1000 - 4)
3333
/* an SPI message cannot be bigger than (2"12-1)*2 bytes
34-
* "*2" to cvt to bytes */
34+
* "*2" to cvt to bytes
35+
*/
3536
#define MAX_SZ_RD_WR_BUFFERS (DOWNLOAD_BLOCK_SIZE_WR*2)
3637
#define PIGGYBACK_CTRL_REG (2)
3738
#define EFFECTIVE_BUF_SIZE (MAX_SZ_RD_WR_BUFFERS - PIGGYBACK_CTRL_REG)
@@ -217,7 +218,8 @@ static int cw1200_device_wakeup(struct cw1200_common *priv)
217218
return ret;
218219

219220
/* If the device returns WLAN_RDY as 1, the device is active and will
220-
* remain active. */
221+
* remain active.
222+
*/
221223
if (ctrl_reg & ST90TDS_CONT_RDY_BIT) {
222224
pr_debug("[BH] Device awake.\n");
223225
return 1;
@@ -262,7 +264,8 @@ static int cw1200_bh_rx_helper(struct cw1200_common *priv,
262264
}
263265

264266
/* Add SIZE of PIGGYBACK reg (CONTROL Reg)
265-
* to the NEXT Message length + 2 Bytes for SKB */
267+
* to the NEXT Message length + 2 Bytes for SKB
268+
*/
266269
read_len = read_len + 2;
267270

268271
alloc_len = priv->hwbus_ops->align_size(

drivers/net/wireless/cw1200/cw1200.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ struct cw1200_common {
207207
/* Scan status */
208208
struct cw1200_scan scan;
209209
/* Keep cw1200 awake (WUP = 1) 1 second after each scan to avoid
210-
* FW issue with sleeping/waking up. */
210+
* FW issue with sleeping/waking up.
211+
*/
211212
atomic_t recent_scan;
212213
struct delayed_work clear_recent_scan_work;
213214

drivers/net/wireless/cw1200/cw1200_sdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ static int cw1200_sdio_probe(struct sdio_func *func,
323323
}
324324

325325
/* Disconnect Function to be called by SDIO stack when
326-
* device is disconnected */
326+
* device is disconnected
327+
*/
327328
static void cw1200_sdio_disconnect(struct sdio_func *func)
328329
{
329330
struct hwbus_priv *self = sdio_get_drvdata(func);

drivers/net/wireless/cw1200/cw1200_spi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,13 @@ struct hwbus_priv {
4747
#define SET_WRITE 0x7FFF /* usage: and operation */
4848
#define SET_READ 0x8000 /* usage: or operation */
4949

50-
/*
51-
Notes on byte ordering:
50+
/* Notes on byte ordering:
5251
LE: B0 B1 B2 B3
5352
BE: B3 B2 B1 B0
5453
5554
Hardware expects 32-bit data to be written as 16-bit BE words:
5655
5756
B1 B0 B3 B2
58-
5957
*/
6058

6159
static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self,

drivers/net/wireless/cw1200/hwio.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ struct download_cntl_t {
9797

9898
#define CW1200_APB(addr) (PAC_SHARED_MEMORY_SILICON + (addr))
9999

100-
/* ***************************************************************
101-
*Device register definitions
102-
*************************************************************** */
100+
/* Device register definitions */
101+
103102
/* WBF - SPI Register Addresses */
104103
#define ST90TDS_ADDR_ID_BASE (0x0000)
105104
/* 16/32 bits */

drivers/net/wireless/cw1200/sta.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,14 @@ void cw1200_update_filtering(struct cw1200_common *priv)
483483
bf_tbl.num = __cpu_to_le32(3);
484484
}
485485

486-
/*
487-
* When acting as p2p client being connected to p2p GO, in order to
488-
* receive frames from a different p2p device, turn off bssid filter.
489-
*
490-
* WARNING: FW dependency!
491-
* This can only be used with FW WSM371 and its successors.
492-
* In that FW version even with bssid filter turned off,
493-
* device will block most of the unwanted frames.
494-
*/
486+
/* When acting as p2p client being connected to p2p GO, in order to
487+
* receive frames from a different p2p device, turn off bssid filter.
488+
*
489+
* WARNING: FW dependency!
490+
* This can only be used with FW WSM371 and its successors.
491+
* In that FW version even with bssid filter turned off,
492+
* device will block most of the unwanted frames.
493+
*/
495494
if (is_p2p)
496495
bssid_filtering = false;
497496

@@ -1015,17 +1014,17 @@ void cw1200_event_handler(struct work_struct *work)
10151014
/* RSSI: signed Q8.0, RCPI: unsigned Q7.1
10161015
* RSSI = RCPI / 2 - 110
10171016
*/
1018-
int rcpiRssi = (int)(event->evt.data & 0xFF);
1017+
int rcpi_rssi = (int)(event->evt.data & 0xFF);
10191018
int cqm_evt;
10201019
if (priv->cqm_use_rssi)
1021-
rcpiRssi = (s8)rcpiRssi;
1020+
rcpi_rssi = (s8)rcpi_rssi;
10221021
else
1023-
rcpiRssi = rcpiRssi / 2 - 110;
1022+
rcpi_rssi = rcpi_rssi / 2 - 110;
10241023

1025-
cqm_evt = (rcpiRssi <= priv->cqm_rssi_thold) ?
1024+
cqm_evt = (rcpi_rssi <= priv->cqm_rssi_thold) ?
10261025
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW :
10271026
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH;
1028-
pr_debug("[CQM] RSSI event: %d.\n", rcpiRssi);
1027+
pr_debug("[CQM] RSSI event: %d.\n", rcpi_rssi);
10291028
ieee80211_cqm_rssi_notify(priv->vif, cqm_evt,
10301029
GFP_KERNEL);
10311030
break;
@@ -1068,8 +1067,7 @@ void cw1200_bss_params_work(struct work_struct *work)
10681067
/* ******************************************************************** */
10691068
/* Internal API */
10701069

1071-
/*
1072-
* This function is called to Parse the SDD file
1070+
/* This function is called to Parse the SDD file
10731071
* to extract listen_interval and PTA related information
10741072
* sdd is a TLV: u8 id, u8 len, u8 data[]
10751073
*/

drivers/net/wireless/cw1200/txrx.c

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ static void tx_policy_build(const struct cw1200_common *priv,
7575
BUG_ON(rates[0].idx < 0);
7676
memset(policy, 0, sizeof(*policy));
7777

78-
/* minstrel is buggy a little bit, so distille
79-
* incoming rates first. */
80-
8178
/* Sort rates in descending order. */
8279
for (i = 1; i < count; ++i) {
8380
if (rates[i].idx < 0) {
@@ -108,7 +105,8 @@ static void tx_policy_build(const struct cw1200_common *priv,
108105
count = i + 1;
109106

110107
/* Re-fill policy trying to keep every requested rate and with
111-
* respect to the global max tx retransmission count. */
108+
* respect to the global max tx retransmission count.
109+
*/
112110
if (limit < count)
113111
limit = count;
114112
if (total > limit) {
@@ -129,7 +127,6 @@ static void tx_policy_build(const struct cw1200_common *priv,
129127
if (count == 2 && !(rates[0].flags & IEEE80211_TX_RC_MCS) &&
130128
rates[0].idx > 4 && rates[0].count > 2 &&
131129
rates[1].idx < 2) {
132-
/* ">> 1" is an equivalent of "/ 2", but faster */
133130
int mid_rate = (rates[0].idx + 4) >> 1;
134131

135132
/* Decrease number of retries for the initial rate */
@@ -151,7 +148,8 @@ static void tx_policy_build(const struct cw1200_common *priv,
151148
/* Fallback to 1 Mbps is a really bad thing,
152149
* so let's try to increase probability of
153150
* successful transmission on the lowest g rate
154-
* even more */
151+
* even more
152+
*/
155153
if (rates[0].count >= 3) {
156154
--rates[0].count;
157155
++rates[2].count;
@@ -220,7 +218,8 @@ static int tx_policy_find(struct tx_policy_cache *cache,
220218
{
221219
/* O(n) complexity. Not so good, but there's only 8 entries in
222220
* the cache.
223-
* Also lru helps to reduce search time. */
221+
* Also lru helps to reduce search time.
222+
*/
224223
struct tx_policy_cache_entry *it;
225224
/* First search for policy in "used" list */
226225
list_for_each_entry(it, &cache->used, link) {
@@ -264,7 +263,8 @@ void tx_policy_clean(struct cw1200_common *priv)
264263
for (idx = 0; idx < TX_POLICY_CACHE_SIZE; idx++) {
265264
entry = &cache->cache[idx];
266265
/* Policy usage count should be 0 at this time as all queues
267-
should be empty */
266+
should be empty
267+
*/
268268
if (WARN_ON(entry->policy.usage_count)) {
269269
entry->policy.usage_count = 0;
270270
list_move(&entry->link, &cache->free);
@@ -319,7 +319,8 @@ static int tx_policy_get(struct cw1200_common *priv,
319319
struct tx_policy_cache_entry *entry;
320320
*renew = true;
321321
/* If policy is not found create a new one
322-
* using the oldest entry in "free" list */
322+
* using the oldest entry in "free" list
323+
*/
323324
entry = list_entry(cache->free.prev,
324325
struct tx_policy_cache_entry, link);
325326
entry->policy = wanted;
@@ -612,7 +613,8 @@ cw1200_tx_h_bt(struct cw1200_common *priv,
612613
priv->listen_interval,
613614
mgt_frame->u.assoc_req.listen_interval);
614615
/* Replace listen interval derieved from
615-
* the one read from SDD */
616+
* the one read from SDD
617+
*/
616618
mgt_frame->u.assoc_req.listen_interval =
617619
priv->listen_interval;
618620
}
@@ -667,7 +669,8 @@ cw1200_tx_h_rate_policy(struct cw1200_common *priv,
667669
pr_debug("[TX] TX policy renew.\n");
668670
/* It's not so optimal to stop TX queues every now and then.
669671
* Better to reimplement task scheduling with
670-
* a counter. TODO. */
672+
* a counter. TODO.
673+
*/
671674
wsm_lock_tx_async(priv);
672675
cw1200_tx_queues_lock(priv);
673676
if (queue_work(priv->workqueue,
@@ -832,8 +835,7 @@ static int cw1200_handle_pspoll(struct cw1200_common *priv,
832835
priv->pspoll_mask |= pspoll_mask;
833836
drop = 0;
834837

835-
/* Do not report pspols if data for given link id is
836-
* queued already. */
838+
/* Do not report pspols if data for given link id is queued already. */
837839
for (i = 0; i < 4; ++i) {
838840
if (cw1200_queue_get_num_queued(&priv->tx_queue[i],
839841
pspoll_mask)) {
@@ -924,7 +926,8 @@ void cw1200_tx_confirm_cb(struct cw1200_common *priv,
924926
cw1200_debug_txed(priv);
925927
if (arg->flags & WSM_TX_STATUS_AGGREGATION) {
926928
/* Do not report aggregation to mac80211:
927-
* it confuses minstrel a lot. */
929+
* it confuses minstrel a lot.
930+
*/
928931
/* tx->flags |= IEEE80211_TX_STAT_AMPDU; */
929932
cw1200_debug_txed_agg(priv);
930933
}
@@ -1044,7 +1047,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
10441047
ieee80211_is_action(frame->frame_control) &&
10451048
(mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) {
10461049
/* Link ID already exists for the ACTION frame.
1047-
* Reset and Remap */
1050+
* Reset and Remap
1051+
*/
10481052
WARN_ON(work_pending(&priv->linkid_reset_work));
10491053
memcpy(&priv->action_frame_sa[0],
10501054
ieee80211_get_SA(frame), ETH_ALEN);
@@ -1074,7 +1078,6 @@ void cw1200_rx_cb(struct cw1200_common *priv,
10741078
if (cw1200_handle_pspoll(priv, skb))
10751079
goto drop;
10761080

1077-
hdr->mactime = 0; /* Not supported by WSM */
10781081
hdr->band = ((arg->channel_number & 0xff00) ||
10791082
(arg->channel_number > 14)) ?
10801083
IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ;
@@ -1102,7 +1105,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11021105
hdr->flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED;
11031106

11041107
/* Oops... There is no fast way to ask mac80211 about
1105-
* IV/ICV lengths. Even defineas are not exposed.*/
1108+
* IV/ICV lengths. Even defineas are not exposed.
1109+
*/
11061110
switch (WSM_RX_STATUS_ENCRYPTION(arg->flags)) {
11071111
case WSM_RX_STATUS_WEP:
11081112
iv_len = 4 /* WEP_IV_LEN */;
@@ -1149,6 +1153,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11491153
hdr->mactime = le64_to_cpu(hdr->mactime);
11501154
if (skb->len >= 8)
11511155
skb_trim(skb, skb->len - 8);
1156+
} else {
1157+
hdr->mactime = 0;
11521158
}
11531159

11541160
cw1200_debug_rxed(priv);
@@ -1192,7 +1198,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11921198

11931199
/* Stay awake after frame is received to give
11941200
* userspace chance to react and acquire appropriate
1195-
* wakelock. */
1201+
* wakelock.
1202+
*/
11961203
if (ieee80211_is_auth(frame->frame_control))
11971204
grace_period = 5 * HZ;
11981205
else if (ieee80211_is_deauth(frame->frame_control))

drivers/net/wireless/cw1200/wsm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,7 @@ static int wsm_cmd_send(struct cw1200_common *priv,
11061106
else
11071107
pr_debug("[WSM] >>> 0x%.4X (%zu)\n", cmd, buf_len);
11081108

1109-
/*
1110-
* Due to buggy SPI on CW1200, we need to
1109+
/* Due to buggy SPI on CW1200, we need to
11111110
* pad the message by a few bytes to ensure
11121111
* that it's completely received.
11131112
*/

0 commit comments

Comments
 (0)