mt76: fix some checkpatch warnings

This fixes the following checkpatch warnings:
CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Ryder Lee
2019-08-21 11:11:15 +08:00
committed by Felix Fietkau
parent 01cfc1b454
commit 13381dcdb3
10 changed files with 70 additions and 63 deletions

View File

@@ -23,7 +23,8 @@ mt76_aggr_release(struct mt76_rx_tid *tid, struct sk_buff_head *frames, int idx)
} }
static void static void
mt76_rx_aggr_release_frames(struct mt76_rx_tid *tid, struct sk_buff_head *frames, mt76_rx_aggr_release_frames(struct mt76_rx_tid *tid,
struct sk_buff_head *frames,
u16 head) u16 head)
{ {
int idx; int idx;
@@ -63,15 +64,14 @@ mt76_rx_aggr_check_release(struct mt76_rx_tid *tid, struct sk_buff_head *frames)
for (idx = (tid->head + 1) % tid->size; for (idx = (tid->head + 1) % tid->size;
idx != start && nframes; idx != start && nframes;
idx = (idx + 1) % tid->size) { idx = (idx + 1) % tid->size) {
skb = tid->reorder_buf[idx]; skb = tid->reorder_buf[idx];
if (!skb) if (!skb)
continue; continue;
nframes--; nframes--;
status = (struct mt76_rx_status *)skb->cb; status = (struct mt76_rx_status *)skb->cb;
if (!time_after(jiffies, status->reorder_time + if (!time_after(jiffies,
REORDER_TIMEOUT)) status->reorder_time + REORDER_TIMEOUT))
continue; continue;
mt76_rx_aggr_release_frames(tid, frames, status->seqno); mt76_rx_aggr_release_frames(tid, frames, status->seqno);
@@ -222,7 +222,8 @@ void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames)
tid->nframes++; tid->nframes++;
mt76_rx_aggr_release_head(tid, frames); mt76_rx_aggr_release_head(tid, frames);
ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work, REORDER_TIMEOUT); ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work,
REORDER_TIMEOUT);
out: out:
spin_unlock_bh(&tid->lock); spin_unlock_bh(&tid->lock);

View File

@@ -509,8 +509,10 @@ struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb)
status->chains = mstat.chains; status->chains = mstat.chains;
BUILD_BUG_ON(sizeof(mstat) > sizeof(skb->cb)); BUILD_BUG_ON(sizeof(mstat) > sizeof(skb->cb));
BUILD_BUG_ON(sizeof(status->chain_signal) != sizeof(mstat.chain_signal)); BUILD_BUG_ON(sizeof(status->chain_signal) !=
memcpy(status->chain_signal, mstat.chain_signal, sizeof(mstat.chain_signal)); sizeof(mstat.chain_signal));
memcpy(status->chain_signal, mstat.chain_signal,
sizeof(mstat.chain_signal));
return wcid_to_sta(mstat.wcid); return wcid_to_sta(mstat.wcid);
} }

View File

@@ -337,7 +337,8 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4; fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4;
if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) { if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) {
q_idx = skb_get_queue_mapping(skb) + wmm_idx * MT7615_MAX_WMM_SETS; q_idx = wmm_idx * MT7615_MAX_WMM_SETS +
skb_get_queue_mapping(skb);
p_fmt = MT_TX_TYPE_CT; p_fmt = MT_TX_TYPE_CT;
} else if (ieee80211_is_beacon(fc)) { } else if (ieee80211_is_beacon(fc)) {
q_idx = MT_LMAC_BCN0; q_idx = MT_LMAC_BCN0;

View File

@@ -14,7 +14,8 @@
#define MAXNAME 32 #define MAXNAME 32
#define DEV_ENTRY __array(char, wiphy_name, 32) #define DEV_ENTRY __array(char, wiphy_name, 32)
#define DEV_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(dev->hw->wiphy), MAXNAME) #define DEV_ASSIGN strlcpy(__entry->wiphy_name, \
wiphy_name(dev->hw->wiphy), MAXNAME)
#define DEV_PR_FMT "%s" #define DEV_PR_FMT "%s"
#define DEV_PR_ARG __entry->wiphy_name #define DEV_PR_ARG __entry->wiphy_name

View File

@@ -206,8 +206,8 @@ mt76_tx_status_skb_get(struct mt76_dev *dev, struct mt76_wcid *wcid, int pktid,
if (cb->pktid == pktid) if (cb->pktid == pktid)
return skb; return skb;
if (pktid >= 0 && if (pktid >= 0 && !time_after(jiffies, cb->jiffies +
!time_after(jiffies, cb->jiffies + MT_TX_STATUS_SKB_TIMEOUT)) MT_TX_STATUS_SKB_TIMEOUT))
continue; continue;
__mt76_tx_status_skb_done(dev, skb, MT_TX_CB_TXS_FAILED | __mt76_tx_status_skb_done(dev, skb, MT_TX_CB_TXS_FAILED |

View File

@@ -309,15 +309,14 @@ mt76u_refill_rx(struct mt76_dev *dev, struct urb *urb, int nsgs, gfp_t gfp)
{ {
struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN];
if (dev->usb.sg_en) { if (dev->usb.sg_en)
return mt76u_fill_rx_sg(dev, q, urb, nsgs, gfp); return mt76u_fill_rx_sg(dev, q, urb, nsgs, gfp);
} else {
urb->transfer_buffer_length = q->buf_size; urb->transfer_buffer_length = q->buf_size;
urb->transfer_buffer = page_frag_alloc(&q->rx_page, urb->transfer_buffer = page_frag_alloc(&q->rx_page, q->buf_size, gfp);
q->buf_size, gfp);
return urb->transfer_buffer ? 0 : -ENOMEM; return urb->transfer_buffer ? 0 : -ENOMEM;
} }
}
static int static int
mt76u_urb_alloc(struct mt76_dev *dev, struct mt76_queue_entry *e, mt76u_urb_alloc(struct mt76_dev *dev, struct mt76_queue_entry *e,
@@ -752,14 +751,15 @@ mt76u_tx_setup_buffers(struct mt76_dev *dev, struct sk_buff *skb,
if (!dev->usb.sg_en) { if (!dev->usb.sg_en) {
urb->transfer_buffer = skb->data; urb->transfer_buffer = skb->data;
return 0; return 0;
} else { }
sg_init_table(urb->sg, MT_TX_SG_MAX_SIZE); sg_init_table(urb->sg, MT_TX_SG_MAX_SIZE);
urb->num_sgs = skb_to_sgvec(skb, urb->sg, 0, skb->len); urb->num_sgs = skb_to_sgvec(skb, urb->sg, 0, skb->len);
if (urb->num_sgs == 0) if (!urb->num_sgs)
return -ENOMEM; return -ENOMEM;
return urb->num_sgs; return urb->num_sgs;
} }
}
static int static int
mt76u_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, mt76u_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid,
@@ -874,7 +874,8 @@ void mt76u_stop_tx(struct mt76_dev *dev)
struct mt76_queue *q; struct mt76_queue *q;
int i, j, ret; int i, j, ret;
ret = wait_event_timeout(dev->tx_wait, !mt76_has_tx_pending(dev), HZ/5); ret = wait_event_timeout(dev->tx_wait, !mt76_has_tx_pending(dev),
HZ / 5);
if (!ret) { if (!ret) {
dev_err(dev->dev, "timed out waiting for pending tx\n"); dev_err(dev->dev, "timed out waiting for pending tx\n");

View File

@@ -14,7 +14,8 @@
#define MAXNAME 32 #define MAXNAME 32
#define DEV_ENTRY __array(char, wiphy_name, 32) #define DEV_ENTRY __array(char, wiphy_name, 32)
#define DEV_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(dev->hw->wiphy), MAXNAME) #define DEV_ASSIGN strlcpy(__entry->wiphy_name, \
wiphy_name(dev->hw->wiphy), MAXNAME)
#define DEV_PR_FMT "%s " #define DEV_PR_FMT "%s "
#define DEV_PR_ARG __entry->wiphy_name #define DEV_PR_ARG __entry->wiphy_name
@@ -54,7 +55,7 @@ DECLARE_EVENT_CLASS(urb_transfer,
TP_PROTO(struct mt76_dev *dev, struct urb *u), TP_PROTO(struct mt76_dev *dev, struct urb *u),
TP_ARGS(dev, u), TP_ARGS(dev, u),
TP_STRUCT__entry( TP_STRUCT__entry(
DEV_ENTRY __field(unsigned, pipe) __field(u32, len) DEV_ENTRY __field(unsigned int, pipe) __field(u32, len)
), ),
TP_fast_assign( TP_fast_assign(
DEV_ASSIGN; DEV_ASSIGN;

View File

@@ -12,7 +12,7 @@
#include <linux/bitfield.h> #include <linux/bitfield.h>
#define MT76_INCR(_var, _size) \ #define MT76_INCR(_var, _size) \
_var = (((_var) + 1) % _size) (_var = (((_var) + 1) % (_size)))
int mt76_wcid_alloc(unsigned long *mask, int size); int mt76_wcid_alloc(unsigned long *mask, int size);