Commit 44b23b48 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

ath9k: hif_usb: Reduce indent 1 column

Invert test and return early.
Move variable declarations to local scope.
Don't initialize variables to 0 unnecessarily.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent eb272441
...@@ -363,9 +363,9 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, ...@@ -363,9 +363,9 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct sk_buff *nskb, *skb_pool[MAX_PKT_NUM_IN_TRANSFER]; struct sk_buff *nskb, *skb_pool[MAX_PKT_NUM_IN_TRANSFER];
int index = 0, i = 0, chk_idx, len = skb->len; int index = 0, i = 0, len = skb->len;
int rx_remain_len = 0, rx_pkt_len = 0; int rx_remain_len, rx_pkt_len;
u16 pkt_len, pkt_tag, pool_index = 0; u16 pool_index = 0;
u8 *ptr; u8 *ptr;
spin_lock(&hif_dev->rx_lock); spin_lock(&hif_dev->rx_lock);
...@@ -399,13 +399,20 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, ...@@ -399,13 +399,20 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
spin_unlock(&hif_dev->rx_lock); spin_unlock(&hif_dev->rx_lock);
while (index < len) { while (index < len) {
u16 pkt_len;
u16 pkt_tag;
u16 pad_len;
int chk_idx;
ptr = (u8 *) skb->data; ptr = (u8 *) skb->data;
pkt_len = ptr[index] + (ptr[index+1] << 8); pkt_len = ptr[index] + (ptr[index+1] << 8);
pkt_tag = ptr[index+2] + (ptr[index+3] << 8); pkt_tag = ptr[index+2] + (ptr[index+3] << 8);
if (pkt_tag == ATH_USB_RX_STREAM_MODE_TAG) { if (pkt_tag != ATH_USB_RX_STREAM_MODE_TAG) {
u16 pad_len; RX_STAT_INC(skb_dropped);
return;
}
pad_len = 4 - (pkt_len & 0x3); pad_len = 4 - (pkt_len & 0x3);
if (pad_len == 4) if (pad_len == 4)
...@@ -421,12 +428,10 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, ...@@ -421,12 +428,10 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
MAX_RX_BUF_SIZE - chk_idx - 4; MAX_RX_BUF_SIZE - chk_idx - 4;
hif_dev->rx_pad_len = pad_len; hif_dev->rx_pad_len = pad_len;
nskb = __dev_alloc_skb(pkt_len + 32, nskb = __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC);
GFP_ATOMIC);
if (!nskb) { if (!nskb) {
dev_err(&hif_dev->udev->dev, dev_err(&hif_dev->udev->dev,
"ath9k_htc: RX memory allocation" "ath9k_htc: RX memory allocation error\n");
" error\n");
spin_unlock(&hif_dev->rx_lock); spin_unlock(&hif_dev->rx_lock);
goto err; goto err;
} }
...@@ -443,8 +448,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, ...@@ -443,8 +448,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
nskb = __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC); nskb = __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC);
if (!nskb) { if (!nskb) {
dev_err(&hif_dev->udev->dev, dev_err(&hif_dev->udev->dev,
"ath9k_htc: RX memory allocation" "ath9k_htc: RX memory allocation error\n");
" error\n");
goto err; goto err;
} }
skb_reserve(nskb, 32); skb_reserve(nskb, 32);
...@@ -454,10 +458,6 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, ...@@ -454,10 +458,6 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
skb_put(nskb, pkt_len); skb_put(nskb, pkt_len);
skb_pool[pool_index++] = nskb; skb_pool[pool_index++] = nskb;
} }
} else {
RX_STAT_INC(skb_dropped);
return;
}
} }
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment