Commit 12f49a79 authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville
Browse files

p54: remove useless code



This patch removes some useless checks in recv/xmit code.
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarChristian Lamparter <chunkeey@web.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 25e83c49
...@@ -87,9 +87,6 @@ static int p54_assign_address(struct p54_common *priv, struct sk_buff *skb) ...@@ -87,9 +87,6 @@ static int p54_assign_address(struct p54_common *priv, struct sk_buff *skb)
u32 target_addr = priv->rx_start; u32 target_addr = priv->rx_start;
u16 len = priv->headroom + skb->len + priv->tailroom + 3; u16 len = priv->headroom + skb->len + priv->tailroom + 3;
if (unlikely(WARN_ON(!skb || !priv)))
return -EINVAL;
info = IEEE80211_SKB_CB(skb); info = IEEE80211_SKB_CB(skb);
range = (void *) info->rate_driver_data; range = (void *) info->rate_driver_data;
len = (range->extra_len + len) & ~0x3; len = (range->extra_len + len) & ~0x3;
...@@ -111,11 +108,6 @@ static int p54_assign_address(struct p54_common *priv, struct sk_buff *skb) ...@@ -111,11 +108,6 @@ static int p54_assign_address(struct p54_common *priv, struct sk_buff *skb)
range = (void *) info->rate_driver_data; range = (void *) info->rate_driver_data;
hole_size = range->start_addr - last_addr; hole_size = range->start_addr - last_addr;
if (!entry->next) {
spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
return -ENOSPC;
}
if (!target_skb && hole_size >= len) { if (!target_skb && hole_size >= len) {
target_skb = entry->prev; target_skb = entry->prev;
hole_size -= len; hole_size -= len;
...@@ -153,9 +145,6 @@ static void p54_tx_pending(struct p54_common *priv) ...@@ -153,9 +145,6 @@ static void p54_tx_pending(struct p54_common *priv)
struct sk_buff *skb; struct sk_buff *skb;
int ret; int ret;
if (unlikely(WARN_ON(!priv)))
return ;
skb = skb_dequeue(&priv->tx_pending); skb = skb_dequeue(&priv->tx_pending);
if (unlikely(!skb)) if (unlikely(!skb))
return ; return ;
...@@ -219,7 +208,7 @@ static int p54_tx_qos_accounting_alloc(struct p54_common *priv, ...@@ -219,7 +208,7 @@ static int p54_tx_qos_accounting_alloc(struct p54_common *priv,
static void p54_tx_qos_accounting_free(struct p54_common *priv, static void p54_tx_qos_accounting_free(struct p54_common *priv,
struct sk_buff *skb) struct sk_buff *skb)
{ {
if (skb && IS_DATA_FRAME(skb)) { if (IS_DATA_FRAME(skb)) {
struct p54_hdr *hdr = (void *) skb->data; struct p54_hdr *hdr = (void *) skb->data;
struct p54_tx_data *data = (void *) hdr->data; struct p54_tx_data *data = (void *) hdr->data;
unsigned long flags; unsigned long flags;
...@@ -266,9 +255,6 @@ static struct sk_buff *p54_find_and_unlink_skb(struct p54_common *priv, ...@@ -266,9 +255,6 @@ static struct sk_buff *p54_find_and_unlink_skb(struct p54_common *priv,
void p54_tx(struct p54_common *priv, struct sk_buff *skb) void p54_tx(struct p54_common *priv, struct sk_buff *skb)
{ {
if (unlikely(WARN_ON(!priv)))
return ;
skb_queue_tail(&priv->tx_pending, skb); skb_queue_tail(&priv->tx_pending, skb);
p54_tx_pending(priv); p54_tx_pending(priv);
} }
......
Supports Markdown
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